The 7 unique letters of the word
PERPLEXUS are permuted in all possible ways and then the new “words” are listed alphabetically.
What "word" is at position 2020 in this list?
.
(This answer seems anti-climactic)
Numerically sorting non digit-repeating sequences of 1234567,
where 1234567 is the 1st and 7654321 is the last, gives the 2020th as 3671452. Using the alphabetic list of letters (1234567 = ELPRSUX), 3671452 decodes as:
PUXERSL
lord@rabbit-3 ~ % 2020
2001 3 6 5 2 4 1 7
2002 3 6 5 2 4 7 1
2003 3 6 5 2 7 1 4
2004 3 6 5 2 7 4 1
2005 3 6 5 4 1 2 7
2006 3 6 5 4 1 7 2
2007 3 6 5 4 2 1 7
2008 3 6 5 4 2 7 1
2009 3 6 5 4 7 1 2
2010 3 6 5 4 7 2 1
2011 3 6 5 7 1 2 4
2012 3 6 5 7 1 4 2
2013 3 6 5 7 2 1 4
2014 3 6 5 7 2 4 1
2015 3 6 5 7 4 1 2
2016 3 6 5 7 4 2 1
2017 3 6 7 1 2 4 5
2018 3 6 7 1 2 5 4
2019 3 6 7 1 4 2 5
2020 3 6 7 1 4 5 2
lord@rabbit-3 ~ % more 2020.f
program s2020
implicit none
integer i1,i2,i3,i4,i5,i6,i7,cnt
cnt=0
do 1 i1=1,7
do 2 i2=1,7
if(i2.eq.i1)go to 2
do 3 i3=1,7
if(i3.eq.i1.or.i3.eq.i2)go to 3
do 4 i4=1,7
if(i4.eq.i1.or.i4.eq.i2.or.i4.eq.i3)go to 4
do 5 i5=1,7
if(i5.eq.i1.or.i5.eq.i2.or.i5.eq.i3.or.
1 i5.eq.i4)go to 5
do 6 i6=1,7
if(i6.eq.i1.or.i6.eq.i2.or.i6.eq.i3.or.
1 i6.eq.i4.or.i6.eq.i5)go to 6
do 7 i7=1,7
if(i7.eq.i1.or.i7.eq.i2.or.i7.eq.i3.or.
1 i7.eq.i4.or.i7.eq.i5.or.i7.eq.i6)go to 7
cnt=cnt+1
if(cnt.gt.2000.and.cnt.le.2020)then
print 8,cnt,i1,i2,i3,i4,i5,i6,i7
8 format (i4,x,7(x,i1))
if(cnt.eq.2020)stop
endif
7 enddo
6 enddo
5 enddo
4 enddo
3 enddo
2 enddo
1 enddo
end
Edited on August 22, 2020, 12:54 pm