|
|
A245571
|
|
a(n) is the smallest prime number with at least two digits formed by the concatenation of the subsequent digits of Pi, starting at the n-th digit, ignoring the decimal point.
|
|
1
|
|
|
31, 14159, 41, 1592653, 59, 9265358979323, 26535897932384626433832795028841971693993751058209, 653, 53, 35897, 5897, 89, 97, 79, 9323, 32384626433832795028841971693993751058209749445923078164062862089986280348253421, 23, 38462643383
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
a(21) has >= 3490 digits, a(22) = 2643383, a(22)-a(42) have 20 or fewer digits. - Chai Wah Wu, Sep 24 2014
|
|
LINKS
|
|
|
EXAMPLE
|
a(4) = 1592653, because starting at the 4th digit in the expansion, the smallest substring of the digits of Pi forming a prime number is 3.14|1592653|589...
|
|
MAPLE
|
N:= 1000: # to use up to N+1 digits of pi.
nmax:= 30: # to get up to a(nmax), if possible.
S:= floor(10^N*Pi):
L:= ListTools:-Reverse(convert(S, base, 10)):
for n from 1 to nmax do
p:= L[n];
for k1 from n+1 to N+1 do
p:= 10*p + L[k1];
if isprime(p) then break fi
od:
if k1 > N+1 then
A[n]:= "Ran out of digits";
break
else
A[n]:= p
end
od:
|
|
PROG
|
(Python)
from sympy.mpmath import *
from sympy import isprime
....mp.dps = 1000+n
....s = nstr(pi, mp.dps)[:-1].replace('.', '')[n-1:]
....for i in range(len(s)-1):
........p = int(s[:i+2])
........if p > 10 and isprime(p):
............return p
....else:
........return 'Ran out of digits'
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|