OFFSET
1,2
FORMULA
a(n) = primepi(next(A054691(n-1))) - primepi(A054691(n-1)) + 1 for n >= 2, where primepi = A000720 and next(k) is the least lesser of twin primes that is larger than k. - Amiram Eldar, May 19 2024
MATHEMATICA
nextLesserTwinPrime[p_Integer] := Block[{q = p + 2}, While[ NextPrime@ q - q > 2, q = NextPrime@ q]; q]; p = 2; q = 3; px = 1; qx = 2; mxd = 0; tpx = 0; lst = {}; While[p <
5090000001, d = qx - px; If[ d > mxd, mxd = d; AppendTo[ lst, d]; Print@ d]; p = q; px = qx; q = nextLesserTwinPrime@ q; qx = PrimePi@ q; tpx++]; lst (* Robert G. Wilson v, May 21 2014 *)
PROG
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Jani Melik, May 15 2014
EXTENSIONS
a(20)-a(28) from Robert G. Wilson v, May 21 2014
a(29)-a(42) from Amiram Eldar, May 19 2024
STATUS
approved