OFFSET
1,2
COMMENTS
Obviously, a(n) = 0 for every odd n except 1. From the list, it appears that a(n) is nonzero for every even n; is this true in general? That is, for each even n, are there primes which differ by n?
FORMULA
a(2*n) = A038664(n). - Michel Marcus, Apr 29 2023
EXAMPLE
a(6) = 9 since k = 9 is the smallest k making prime(k+1)-prime(k) = 6.
a(3) = 0 since no two consecutive primes differ by 3.
MATHEMATICA
f[n_] := Prime[n + 1] - Prime[n]; g[n_] := Min[Select[Range[1, 10^4], f[ # ] == n &]]; Table[g[i], {i, 1, 50}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Jan 03 2002
STATUS
approved