login
A051729
Smallest number at distance 2n+1 from nearest prime.
3
1, 26, 118, 120, 532, 1140, 1340, 1342, 1344, 15702, 15704, 19632, 19634, 31424, 31426, 31428, 31430, 31432, 155958, 155960, 155962, 155964, 360698, 360700, 370310, 370312, 370314, 370316, 492170, 1349592, 1357262, 1357264, 1357266, 2010800, 2010802, 2010804, 2010806
OFFSET
0,2
FORMULA
a(n) = A051652(2*n+1). - Sean A. Irvine, Oct 01 2021
MATHEMATICA
seq[max_] := Module[{s = Table[0, {max}], c = 1, n = 4}, s[[1]] = 1; While[c < max, i = (Min[n - NextPrime[n, -1], NextPrime[n] - n] + 1)/2; If[i <= max && s[[i]] == 0, c++; s[[i]] = n]; n += 2]; s] ; seq[20] (* Amiram Eldar, Aug 28 2021 *)
CROSSREFS
KEYWORD
nonn,easy,nice
EXTENSIONS
More terms from James A. Sellers, Dec 07 1999
More terms from Amiram Eldar, Aug 28 2021
STATUS
approved