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.

A104842 Position of the first sequence of n subsequent digits of Pi which form a prime.

Original entry on oeis.org

1, 1, 8, 3, 2, 1, 4, 34, 30, 5, 15, 2, 6, 17, 36, 82, 12, 87, 26, 12, 25, 133, 35, 18, 17, 3, 41, 17, 234, 17, 167, 92, 251, 15, 9, 12, 31, 1, 57, 290, 4, 99, 98, 502, 48, 164, 198, 201, 128, 7, 363, 143, 11, 138, 196, 32, 230, 82, 292, 515, 334, 186, 176, 223, 57, 135, 35
Offset: 1

Views

Author

Zak Seidov, Mar 27 2005

Keywords

Comments

Note that values with indices n = 22, 43, 55, ... are positions of primes with leading zeros, which is in particular manifest from a(42)=99, a(43)=98. See A198344 for the position of the "true" n-digit primes listed in A104841. - M. F. Hasler, Oct 23 2011

Examples

			a(1)=1 since the first single-digit prime found, 3, is at first place, hence a(1)=1,
a(2)=1 since the first two-digit prime found, 31, is at first place, hence a(2)=1,
a(3)=8 since the first three-digit prime found, 653, is at 8th place, hence a(3)=8, ...
		

Crossrefs

Programs

  • Mathematica
    pi = RealDigits[Pi, 10, 100][[1]]; f[n_] := Block[{k = 1}, While[ !PrimeQ[ FromDigits[ Take[pi, {k, k + n - 1}]]], k++ ]; k]; Table[ f[n], {n, 67}] (* Robert G. Wilson v, Mar 29 2005 *)
  • PARI
    a(n)={for(c=-1,default(realprecision)-n-2,ispseudoprime(Pi\.1^(n+c)%10^n)&return(c+2));error("Insufficient realprecision, please increase.")}  \\  M. F. Hasler, Oct 23 2011

Extensions

More terms from a(33) onward from Robert G. Wilson v, Mar 29 2005