OFFSET
1,1
COMMENTS
Sum of reciprocals = 0.43523579465477...
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..1000 First 101 from Abhiram R Devesh
FORMULA
a(n) = A124001(n-1) + 10^(n-1). - Robert G. Wilson v, Nov 28 2015
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:
seq(A[n], n=1..100); # Robert Israel, Aug 04 2014
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)
# Abhiram R Devesh, Aug 02 2014
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Cino Hilliard, Feb 17 2004
EXTENSIONS
Corrected by T. D. Noe, Nov 15 2006
STATUS
approved