OFFSET
1,1
COMMENTS
If n=A047845(i)^2 for some i, i.e. if n has the form ((k-1)/2)^2 with k odd but not prime, then a(n)=0. It is conjectured that these are the only values of n for which a(n)=0; this would follow from Schinzel's hypothesis.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Schinzel's Hypothesis.
EXAMPLE
a(8) = 17 because 8 + 17 is the first square that can be made by adding a prime to 8.
a(16) = 0 because 16 + p cannot be x^2, since then p = x^2 - 16 = (x-4)(x+4).
MATHEMATICA
a[n_] := If[IntegerQ[s=Sqrt[n]]&&!PrimeQ[2s+1], 0, For[x=Ceiling[s], True, x++, If[PrimeQ[x^2-n], Return[x^2-n]]]]
PROG
(PARI) for(n=1, 100, f=0:forprime(p=2, 10^7, if(issquare(p+n), f=p:break)): if(f, print1(f", "), print1("0, ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Sep 23 2002
EXTENSIONS
More terms from Ralf Stephan, Mar 28 2003
Edited by Dean Hickerson, Mar 31 2003
STATUS
approved