OFFSET
0,2
COMMENTS
An old ARML problem asked for the smallest n>0 such that a(n) does not exist.
LINKS
T. D. Noe, Table of n, a(n) for n = 0..10000
EXAMPLE
a(8) = 5 because 5^2 - 8 = 17 is the smallest square that gives a prime difference.
a(16) = 0 because if x^2 - 16 is prime, then a prime equals (x+4)(x-4), which is impossible.
MATHEMATICA
Table[s = Sqrt[n]; If[IntegerQ[s], If[PrimeQ[(s + 1)^2 - n], k = s + 1, k = 0], k = Ceiling[s]; While[! PrimeQ[k^2 - n], k++]]; k, {n, 0, 100}] (* T. D. Noe, Apr 17 2011 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Joshua Zucker, Mar 31 2005
STATUS
approved