A307582
Position of the first occurrence of (0, 1, ..., n-1) in the digits of Pi written in base n.
Original entry on oeis.org
2, 7, 188, 2264, 27931, 110808, 23489363, 97438020
Offset: 2
Pi written in base 2 is 11.001...[2], so the first "01" occurs at position a(2) = 2.
Pi written in base 3 is 10.010211012...[3], we see that the first occurrence of the string "012" is at position a(3) = 7.
Pi written in base 4 is 3.02100333...[4]; the string of digits "0123" does not occur until position a(4) = 188.
Cf.
A307581 (first occurrence of any permutation of 0 .. n-1, in base-n digits of Pi).
Cf.
A307583 (start of last permutation of {0 .. n-1} not to occur earlier, in base-n digits of Pi).
-
A307582(n,x=Pi,m=Mod(sum(i=1,n-1,i*n^(n-1-i)),n^n))={for(k=0,oo,x\n^-k==m&&return(k-n+1))} \\ Ensure sufficient precision of the argument x = Pi.
A307583
Position where the last of all n! permutations of { 0 .. n-1 } occurs in the digits of Pi written in base n.
Original entry on oeis.org
2, 82, 961, 15136
Offset: 2
Pi written in base 2 is 11.001...[2], so the first "10" occurs at position 0 (starting with the digit of units) and "01" occurs later at position a(2) = 2.
Pi written in base 3 is 10.010211012...[3], we see that the first permutation of 0..2 to appear is "102", at position 2; then "021" at position 3, then "012" at position 7, then "201" at position 12, then "120" at position 39, and finally "210", the last partition not occurring earlier, at position 82 = a(3).
Pi written in base 4 is 3.02100333...[4]; the first permutation of 0..3 is "3012" at position 0 (starting at units digit '3'), the next distinct permutation to occur is "2031" at position 27 etc.; the last permutation not to occur earlier is "2310" at position 961 = a(4).
Cf.
A307581 (first start of any permutation of 0 .. n-1 in base-n digits of Pi).
Cf.
A307582 (first occurrence of "01...(n-1)" in digits of Pi written in base n).
-
A307583(n,x=Pi,m=n^n,S=[])={for(k=n-2,oo, #Set(d=digits(x\n^-k%m,n)) < n-1 && next; #Set(d)==n || vecsort(d)==[1..n-1] || next; setsearch(S,d) && next; printf("%d: %d, ",k-n+1,Vec(d,-n));S=setunion(S,[d]);#S==n!&&return(k-n+1))}
Showing 1-2 of 2 results.
Comments