VOOZH
about
URL: https://oeis.org/A104841
⇱ A104841 - OEIS
login
A104841
The first n-digit prime occurring in the decimal expansion of Pi,
A000796
.
7
3, 31, 653, 4159, 14159, 314159, 1592653, 28841971, 795028841, 5926535897, 93238462643, 141592653589, 9265358979323, 23846264338327, 841971693993751, 8628034825342117, 89793238462643383, 348253421170679821, 3832795028841971693, 89793238462643383279
(
list
;
graph
;
refs
;
listen
;
history
;
text
;
internal format
)
OFFSET
1,1
COMMENTS
For the next n-digit primes, see the b-file (link).
Sequence
A198344
gives the position of these primes withing the digits of Pi.
LINKS
Michael S. Branicky,
Table of n, a(n) for n = 1..1000
(terms 1..162 from M. F. Hasler)
PROG
(PARI) default(realprecision, 2000);
A104841
(n)={for( c=0, default(realprecision)-n-2, Pi\.1^c%10 & ispseudoprime(p=Pi\.1^(n+c-1)%10^n) & return(p)); error("Please increase default(realprecision) to calculate
A104841
("n").")} \\
M. F. Hasler
, Oct 23 2011
(Python)
from sympy import S, isprime
pi = "3"+str(S.Pi.n(10**5))[2:] # or load data from file
def
A104841
_
A198344
(n): return next(((p, i+1) for i in range(len(pi)-n) if pi[i]!="0" and isprime(p:=int(pi[i:i+n]))), "not enough digits")
print([
A104841
_
A198344
(n)[0] for n in range(1, 21)]) #
Michael S. Branicky
, Dec 28 2022
CROSSREFS
Cf.
A104819
-
A104842
.
Cf.
A000796
,
A198344
.
Sequence in context:
A377746
A368489
A380513
*
A092552
A322487
A300735
Adjacent sequences:
A104838
A104839
A104840
*
A104842
A104843
A104844
KEYWORD
nonn
,
base
AUTHOR
Zak Seidov
, Mar 27 2005
STATUS
approved