A103186 a(n) is the position of the start of the first occurrence of n > a(n-1) after the decimal point in Pi = 3.14159265358979323846264338327950288...
1, 6, 9, 19, 31, 41, 47, 52, 55, 163, 174, 220, 281, 295, 314, 396, 428, 446, 495, 600, 650, 661, 698, 803, 822, 841, 977, 1090, 1124, 1358, 1435, 1501, 1667, 1668, 1719, 1828, 1926, 1968, 1987, 2007, 2161, 2210, 2236, 2261, 2305, 2416, 2509, 2555, 2595
Offset: 1
Examples
Moving always to the right in the decimal expansion of Pi, the string "1" is found at position 1 counting from the first digit after the decimal point, the string "2" is found at position 6, the string "3" at position 6, the string "4" at position 19, etc.
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..9999
- Dave Andersen, The Pi-Search Page.
- Bob Happelberg, Bob's Poetry Page for Feb 2005
Programs
-
Magma
k := 3000; R := RealField(k); S := IntegerToString(Round(10^k*(-3 + Pi(R)))); Q := []; d := 0; for n in [1..49] do p:= Position(S, IntegerToString(n)); d+:=p; Append(~Q, d); S := Substring(S, p+1, #S-p); end for; Q; /* Klaus Brockhaus, Feb 15 2007 */
-
Mathematica
p = ToString[ FromDigits[ RealDigits[ N[Pi - 3, 2600]][[1]]]]; lst = {0}; Do[a = StringPosition[p, ToString[n], 1][[1, 1]]; AppendTo[lst, a + lst[[ -1]]]; p = StringDrop[p, a], {n, 49}]; Rest[lst] (* Robert G. Wilson v, Mar 19 2005 *)
-
PARI
lista(nn, t=10^5) = {default(realprecision, t); my(d, k, v=digits(floor(Pi*10^t))); for(n=1, nn, d=digits(n); until(v[k+1..k+#d]==d, k++); print1(k, ", ")); } \\ Jinyuan Wang, Feb 18 2021
Extensions
More terms from Graeme McRae and Robert G. Wilson v, Mar 19 2005
Comments