OFFSET
0,1
COMMENTS
As N increases, the ratio (Sum_{n=1..N} a(n)/n^2)/N tends to 4. - Pierre CAMI, Jul 12 2013
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 0..1250 (first 476 terms from Pierre CAMI).
FORMULA
a(n) = A092245(n+1) - 10^n. - Robert G. Wilson v, Nov 28 2015
EXAMPLE
a(0) = 2 because 3 and 5 are twin primes and 3 - 10^0 = 2,
a(1) = 1 because 11 and 13 are twin primes and 11 - 10^1 = 1,
a(2) = 1 because 101 and 103 are twin primes and 101 - 10^2 = 1,
a(3) = 19 because 1019 and 1021 are twin primes and 1019 - 10^3 = 19, etc.
MATHEMATICA
f[n_] := Block[{p = q = NextPrime[10^n]}, While[p + 2 != q, p = q; q = NextPrime@ q]; p - 10^n]; Array[f, 49, 0] (* Robert G. Wilson v, Nov 28 2015 *)
ftp[n_]:=Module[{p=NextPrime[n]}, While[CompositeQ[p+2], p=NextPrime[p]]; p-n]; Table[ftp[10^n], {n, 0, 50}] (* Harvey P. Dale, Oct 15 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Nov 01 2006
STATUS
approved