OFFSET
1,3
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
EXAMPLE
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, ...
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Zak Seidov, Mar 27 2005
EXTENSIONS
More terms from a(33) onward from Robert G. Wilson v, Mar 29 2005
STATUS
approved