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-5 of 5 results.

A032445 Number the digits of the decimal expansion of Pi: 3 is the first, 1 is the second, 4 is the third and so on; a(n) gives the starting position of the first occurrence of n.

Original entry on oeis.org

33, 2, 7, 1, 3, 5, 8, 14, 12, 6, 50, 95, 149, 111, 2, 4, 41, 96, 425, 38, 54, 94, 136, 17, 293, 90, 7, 29, 34, 187, 65, 1, 16, 25, 87, 10, 286, 47, 18, 44, 71, 3, 93, 24, 60, 61, 20, 120, 88, 58, 32, 49, 173, 9, 192, 131, 211, 405, 11, 5, 128, 220, 21, 313, 23, 8, 118, 99, 606
Offset: 0

Views

Author

Jeff Burch, Paul Simon (paulsimn(AT)microtec.net)

Keywords

Comments

See A176341 for a variant counting positions starting with 0, and A232013 for a sequence based on iterations of A176341. - M. F. Hasler, Nov 16 2013

Examples

			a(10) = 50 because the first "10" in the decimal expansion of Pi occurs at digits 50 and 51: 31415926535897932384626433832795028841971693993751058209749445923...
		

Crossrefs

Cf. A000796 (decimal expansion of Pi).
Cf. A080597 (terms from the decimal expansion of Pi which include every combination of n digits as consecutive subsequences).
Cf. A032510 (last string seen when scanning the decimal expansion of Pi until all n-digit strings have been seen).
Cf. A064467 (primes in Pi).

Programs

  • Mathematica
    p = ToString[FromDigits[RealDigits[N[Pi, 10^4]][[1]]]]; Do[Print[StringPosition[p, ToString[n]][[1]][[1]]], {n, 1, 100}]
    With[{pi=RealDigits[Pi,10,1000][[1]]},Transpose[Flatten[Table[ SequencePosition[ pi,IntegerDigits[n],1],{n,0,70}],1]][[1]]] (* The program uses the SequencePosition function from Mathematica version 10 *) (* Harvey P. Dale, Dec 01 2015 *)
  • PARI
    A032445(n)=my(L=#Str(n)); n=Mod(n, 10^L); for(k=L-1, 9e9, Pi\.1^k-n||return(k+2-L)) \\ Make sure to use sufficient realprecision, e.g. via \p999. - M. F. Hasler, Nov 16 2013

Formula

a(n) = A176341(n)+1. - M. F. Hasler, Nov 16 2013

Extensions

More terms from Simon Plouffe. Corrected by Michael Esposito and Michelle Vella (michael_esposito(AT)oz.sas.com).
More terms from Robert G. Wilson v, Oct 04 2001

A176341 a(n) = the location of the first appearance of the decimal expansion of n in the decimal expansion of Pi.

Original entry on oeis.org

32, 1, 6, 0, 2, 4, 7, 13, 11, 5, 49, 94, 148, 110, 1, 3, 40, 95, 424, 37, 53, 93, 135, 16, 292, 89, 6, 28, 33, 186, 64, 0, 15, 24, 86, 9, 285, 46, 17, 43, 70, 2, 92, 23, 59, 60, 19, 119, 87, 57, 31, 48, 172, 8, 191, 130, 210, 404, 10, 4, 127, 219, 20, 312, 22, 7, 117, 98, 605, 41
Offset: 0

Views

Author

Daniel E. Loeb, Apr 15 2010

Keywords

Comments

It is unknown whether Pi is a normal number. If it is (at least in base 10) then this sequence is well defined.
The numbers a(n) refer to the position of the initial digit of n in the decimal expansion of Pi, where "3" is at position a(3)=0, "1" is at position a(1)=1, etc. This is also the numbering scheme used on the "Pi search page" cited among the LINKS. See A232013 for a sequence based on iterations of this one. See A032445 for a variant of the present sequence, where numbering starts at one. - M. F. Hasler, Nov 16 2013

Crossrefs

Programs

  • Mathematica
    p=ToString[FromDigits[RealDigits[N[Pi, 10^4]][[1]]]]; Do[Print[StringPosition[p, ToString[n]][[1]][[1]] - 1], {n, 0, 100}] (* Vincenzo Librandi, Apr 17 2017 *)
    With[{pid=RealDigits[Pi,10,800][[1]]},Flatten[Table[ SequencePosition[ pid,IntegerDigits[n],1],{n,0,70}],1]][[All,1]]-1 (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 27 2019 *)
  • PARI
    A176341(n)=my(L=#Str(n));n=Mod(n,10^L);for(k=L-1,9e9,Pi\.1^k-n||return(k+1-L)) \\ Make sure to use sufficient realprecision, e.g. via \p999. - M. F. Hasler, Nov 16 2013
  • Python
    pi = "314159265358979323846264338327950288419716939937510582097494459230..."
    [ pi.find(str(i)) for i in range(10000) ]
    

Formula

a(n) = A032445(n)-1. - M. F. Hasler, Nov 16 2013
a(n) = 0 if n is in A011545, otherwise a(n) = A014777(n). - Pontus von Brömssen, Aug 31 2024

A228412 Number of iterations of A176341 ("position of m in Pi") starting with n until a loop is reached.

Original entry on oeis.org

0, 0, 8, 0, 9, 10, 7, 6
Offset: 0

Views

Author

M. F. Hasler, Nov 16 2013

Keywords

Comments

"A loop is reached" means that an element x is reached such that (A176341^k)(x) = x for some k>0.

Examples

			a(0)=a(1)=a(3)=0 since 0 and 3 are elements of the loop 0 -> 32 -> 15 -> 3 -> 0, and 1 is a fixed point (i.e., loop of length 1) of A176341.
a(2)=8 is the number of steps in 2 -> 6 -> 7 -> 13 -> 110 -> 174 -> 155 -> 314 -> 0, at which point the previously mentioned loop is reached.
		

Crossrefs

Programs

  • PARI
    A228412(n)={my(u=0);for(i=1,9e9,u+=1<A176341(n))&&return(i-A232013(n)))}

A232014 Number of iterations of A032445 ("position of n in Pi") until a value is reached for the second time, when starting with n, or -1 if no value is repeated.

Original entry on oeis.org

16, 4, 3, 5, 6, 1
Offset: 0

Views

Author

M. F. Hasler, Nov 16 2013

Keywords

Comments

See A232013 for a variant based on A176341 instead of A032445.
Some loops: (5), (271070), (9292071), (40, 71), (2, 7, 14), (296, 1060, 13737, 133453, 646539, 294342, 141273). - Hans Havermann, Jul 26 2014
See Hans Havermann table (in links) for primary unknown-length evolutions. - Hans Havermann, Aug 06 2014

Examples

			a(1)=4 since A032445(1)=2 (the first "1" occurs after the initial "3" as second digit in Pi), A032445(2)=7 (the first "2" occurs as 7th digit of Pi's decimal expansion), A032445(7)=14, A032445(14)=2, which "closes the loop" after 4 iterations. (The initial value does not need to be part of the loop.)
		

Crossrefs

Cf. A032445.

Programs

  • PARI
    A232014(n)={my(u=0);for(i=1,9e9,u+=1<A032445(n))&&return(i))}

Extensions

Definition modified by N. J. A. Sloane, Jul 29 2014

A280532 a(1) = a(2) = 1, a(n) = A014777(a(n-1) + a(n-2)), n >= 3.

Original entry on oeis.org

1, 1, 6, 13, 37, 31, 605, 1411, 7174, 15567, 608953, 78903, 334535, 611552, 105928, 2557047, 2979162, 3263358, 6242520, 7825254, 37404834, 267494881, 639174488
Offset: 1

Views

Author

Anders Hellström, Jan 13 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{a = {1, 1}, s = First@ RealDigits[N[Pi, 10^7]]}, Do[AppendTo[a, -1 + SequencePosition[s, IntegerDigits[ a[[n - 1]] + a[[n - 2]] ]][[1, 1]]], {n, 3, 20}]; a] (* Michael De Vlieger, Jan 14 2017 *)
Showing 1-5 of 5 results.