Reply To: Programming
The mystery of the silver bullet › Forums › The Intelligence Room › Programming › Reply To: Programming
#######################################################################
Did you know that there are 362879 consecutive entries containing the
17 letter phrase starting at the 390304790967593360819076480th entry
and ending in the 390304790967593360819439359th entry!
#######################################################################
\\ HERE ARE MY PARI-gp CODE WORKOUTS
\\ ————————————————–
\\ find how many more lines, if any, below the given entry
s=390304790967593360819076481;
v=numtoperm(26,s);
vs=v;
u=v[1..17];
c=0;until(v[1..17]!=u,c++;s-=1;v=numtoperm(26,s));
v=numtoperm(26,s+1);
print(” : “,c-1,”\n : “,vs,”\n : “,v,”\n : “,s+1);
: 1
: [26, 5, 2, 18, 1, 19, 4, 15, 14, 20, 6, 12, 25, 13, 21, 3, 8, 7, 9, 10, 11, 16, 17, 22, 24, 23]
: [26, 5, 2, 18, 1, 19, 4, 15, 14, 20, 6, 12, 25, 13, 21, 3, 8, 7, 9, 10, 11, 16, 17, 22, 23, 24]
: 390304790967593360819076480
\\ ————————————————–
\\ find how many more lines above the given entry
s=390304790967593360819076481;
v=numtoperm(26,s);
vs=v;
u=v[1..17];
c=0;until(v[1..17]!=u,c++;s+=1;v=numtoperm(26,s));
v=numtoperm(26,s-1);
print(” : “,c-1,”\n : “,vs,”\n : “,v,”\n : “,s-1);
: 362878
: [26, 5, 2, 18, 1, 19, 4, 15, 14, 20, 6, 12, 25, 13, 21, 3, 8, 7, 9, 10, 11, 16, 17, 22, 24, 23]
: [26, 5, 2, 18, 1, 19, 4, 15, 14, 20, 6, 12, 25, 13, 21, 3, 8, 24, 23, 22, 17, 16, 11, 10, 9, 7]
: 390304790967593360819439359
\\ ————————————————
\\ Find all entry lines that give the message
\\ (lowest entry computed separately, see above
\\ found to be one less than 390304790967593360819076481)
s=390304790967593360819076480;\\ lowest entry
v=numtoperm(26,s);
sv=v;
u=v[1..17];
\\ find how many more than the given entry
c=0;while(v[1..17]==u,c++;s+=1;v=numtoperm(26,s));
{print(“\n Lines with phrase = \t”,c-1);
print(” Last Entry Line is \t”,s-1);
print(” Check entry numbers \t”,v);
print(” against start Line \t”,sv);
print(“\t\t\tThe first 17 numbers should match”);}
Lines with phrase = 362879
Last Entry Line is 390304790967593360819439359
Check entry numbers [26, 5, 2, 18, 1, 19, 4, 15, 14, 20, 6, 12, 25, 13, 21, 3, 9, 7, 8, 10, 11, 16, 17, 22, 23, 24]
against start Line [26, 5, 2, 18, 1, 19, 4, 15, 14, 20, 6, 12, 25, 13, 21, 3, 8, 7, 9, 10, 11, 16, 17, 22, 23, 24]
The first 17 numbers should match
\\ Confirm The Decryptions
\\ Lowest line entry
entry=390304790967593360819076480;
alphaU=Vec(Str(ABCDEFGHIJKLMNOPQRSTUVWXYZ));
v=numtoperm(26,entry);
for(i=1,#v,print1(alphaU[v[i]]));
[deleted output answer]*
\\ highest line entry
entry=390304790967593360819439359;
alphaU=Vec(Str(ABCDEFGHIJKLMNOPQRSTUVWXYZ));
v=numtoperm(26,entry);
for(i=1,#v,print1(alphaU[v[i]]));
[deleted output answer]*
*both check out to be the same
Addendum:
Of the 26 numbers/letters 17 make the phrase leaving 9 to be arranged in 9! = 362880 ways.
Actually 9!-1 so 362879 will be the count of entries that have the phrase.
These entry line numbers start at 390304790967593360819076480 and if we add
362879 to that they finish at 390304790967593360819439359