|
|
A092245
|
|
Lesser of the first twin prime pair with n digits.
|
|
4
|
|
|
3, 11, 101, 1019, 10007, 100151, 1000037, 10000139, 100000037, 1000000007, 10000000277, 100000000817, 1000000000061, 10000000001267, 100000000000097, 1000000000002371, 10000000000001549, 100000000000000019
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Sum of reciprocals = 0.43523579465477...
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
for n from 1 to 100 do
r:= 10^(n-1);
p:= nextprime(r); q:= nextprime(p);
while q - p > 2 do
p:= q; q:= nextprime(p);
od;
A[n]:= p;
od:
|
|
MATHEMATICA
|
a[n_] := Block[{p = NextPrime[10^(n -1)]}, While[ !PrimeQ[p +2], p = NextPrime@ p]; p]; Array[a, 18] (* Robert G. Wilson v, Dec 04 2022 *)
|
|
PROG
|
(PARI) firsttwpr(n) = { sr=0; for(m=0, n, c=0; for(x=10^m+1, 10^(m+1), if(isprime(x)&& isprime(x+2), print1(x", "); sr+=1./x; break) ) ); print(); print(sr) }
(Python)
import sympy
for i in range(100):
p=sympy.nextprime(10**i)
while not sympy.isprime(p+2):
p=sympy.nextprime(p)
print(p)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|