cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A307581 Position of the first permutation of { 0 .. n-1 } occurring in the digits of Pi written in base n.

Original entry on oeis.org

0, 2, 0, 6, 15, 5, 371, 742, 60, 787
Offset: 2

Views

Author

M. F. Hasler, Apr 15 2019

Keywords

Comments

"The first permutation of {0 .. n-1}" means the first string of n distinct digits.
"Position" means the index of the digit where this string begins, where index = p means the digit corresponding to n^-p: e.g., the first digit after the decimal point would have index 1.
By inspection, a(12) > 1000. - Alvin Hoover Belt, Mar 17 2021

Examples

			Pi written in base 2 is 11.0...[2] so "10" occurring at position a(2) = 0 (digits corresponding to 2^0 and 2^-1) is the first permutation of the digits 01 to occur in the digits of Pi written in base 2.
Pi written in base 3 is 10.0102...[3], so "102" occurring at position a(3) = 2 (the string starts at the digit corresponding to 3^-2) is the first permutation of digits 012 to occur in the digits of Pi written in base 3.
Pi written in base 4 is 3.021...[4], so "3021" occurring at position a(4) = 0 (the string starts at the digit corresponding to 4^0) is the first permutation of digits 0123 to occur in the digits of Pi written in base 4.
Pi written in base 5 is 3.0323221430...[5], so "21430" occurring at position a(5) = 6 (the string starts at the digit corresponding to 5^-6) is the first permutation of digits 01234 to occur in the digits of Pi written in base 5.
Pi = 3.141592653589793238462643383279502884197169399375105820974944592307816... (in base 10) has the first string of 10 distinct digits, "4592307816", starting at position a(10) = 60.
		

Crossrefs

Cf. A307582 (start of first occurrence of (0, ..., n-1) in digits of Pi in base n).
Cf. A307583 (start of last permutation of {0 .. n-1} not to occur earlier, in base-n digits of Pi).

Programs

  • PARI
    A307581(n,x=Pi,m=n^n)=for(k=0,oo,#Set(d=digits(x\n^-k%m,n))>=n && (#Set(d)==n||vecsort(d)==[1..n-1]) && return([k-n+1,digits(x\n^-k,n)])) \\ Returns position and the digits up to there. Ensure sufficient realprecision (\p): an error should occur if a suitable permutation of digits is not found early enough, but in case of results near the limit of precision, it is suggested to double check (by increasing the precision further) that the relevant digits are all correct.

Formula

a(n) <= A307582(n) <= A307583(n).

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

Views

Author

M. F. Hasler, Apr 15 2019

Keywords

Comments

By "permutation of { 0 .. n-1 }" we mean a string of n distinct digits. "The last" means the permutation which occurs for the first time later than all other permutations.
Position = k means that the string starts with the digit corresponding to the weight n^-k; e.g., the first digit after the decimal point has position 1.

Examples

			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).
		

Crossrefs

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).
Cf. A068987 (occurrence of 123...n in decimal digits of Pi), A121280.

Programs

  • PARI
    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.