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.

A014777 Position of the start of the first occurrence of n after the decimal point in Pi = 3.14159265358979323846264338327950288...

This page as a plain text file.
%I A014777 #46 Jun 22 2022 07:43:22
%S A014777 32,1,6,9,2,4,7,13,11,5,49,94,148,110,1,3,40,95,424,37,53,93,135,16,
%T A014777 292,89,6,28,33,186,64,137,15,24,86,9,285,46,17,43,70,2,92,23,59,60,
%U A014777 19,119,87,57,31,48,172,8,191,130,210,404,10,4,127,219,20,312,22,7,117,98,605
%N A014777 Position of the start of the first occurrence of n after the decimal point in Pi = 3.14159265358979323846264338327950288...
%C A014777 This is A037008(1), A037000(1), A037001(1), A037002(1), A037003(1), A037004(1), A037005(1), A036974(1), A037006(1), A037007(1) etc.
%H A014777 Ronald R. King and T. D. Noe, <a href="/A014777/b014777.txt">Table of n, a(n) for n = 0..9999</a>
%H A014777 Dave Andersen, <a href="http://www.angio.net/pi/piquery">The Pi-Search Page</a>.
%H A014777 Tom Crawford and Brady Haran, <a href="https://www.youtube.com/watch?v=W20aT14t8Pw">Strings and Loops within Pi</a>, Numberphile video (2020)
%H A014777 Anders Hellström, <a href="/A014777/a014777_1.spyx.txt">Sage program</a>, Feb 02 2017
%e A014777 In the decimal expansion of Pi, the string "0" is found at position 32 counting from the first digit after the decimal point. The string "1" is found at position 1, the string "2" at position 6, the string "3" at position 9, etc.
%t A014777 Table[-1 + SequencePosition[#, IntegerDigits@ n][[1, 1]], {n, 0, 68}] &@ First@ RealDigits@ N[Pi, 10^4] (* _Michael De Vlieger_, Aug 10 2016, Version 10.1 *)
%o A014777 (Magma) k := 700; R := RealField(k); [ Position(IntegerToString(Round(10^k*(-3 + Pi(R)))), IntegerToString(n)) : n in [0..68] ]; /* _Klaus Brockhaus_, Feb 15 2007 */
%o A014777 (PARI) M14777=Map(); A014777(n)={iferr(mapget(M14777, n), E, my(i=if(n>9, A014777(n\10), 1), d=if(n, digits(n), [0]), j); while(i++, j=#d; until(!j, d[j]==A000796(i+j--) || next(2)); break); mapput(M14777, n, i--); i)} \\ _M. F. Hasler_, Jun 21 2022
%o A014777 (Python)
%o A014777 from mpmath import mp
%o A014777 def A014777(n):
%o A014777     if not (i := A014777.pos.get(n, 0)):
%o A014777         d = str(n); s = 2 # starting position for search
%o A014777         while (i := A014777.pi.find(d, s)) < 1:
%o A014777             s = max(len(A014777.pi) - len(d), 2)
%o A014777             with mp.workdps(s + 99 if s < 500 else s*6//5): # new precision
%o A014777                 A014777.pi = str(mp.pi - 5/mp.mpf(10)**mp.dps) # don't round
%o A014777         i -= 1; A014777.pos[n] = i
%o A014777     return i
%o A014777 A014777.pi = ''; A014777.pos = {} # _M. F. Hasler_, Jun 21 2022
%Y A014777 Cf. A000796, A078197, A103186 (another version).
%Y A014777 Cf. A037008, A037000, A037001, A037002, A037003, A037004, A037005, A036974, A037006, A037007.
%K A014777 nonn,base
%O A014777 0,1
%A A014777 Paul Simon (paulsimn(AT)microtec.net) and _Simon Plouffe_
%E A014777 More terms from _Klaus Brockhaus_, Feb 15 2007