OFFSET
1,2
EXAMPLE
Given a(5) = 30, the least k > 30 such that k + 30 is square and k - 30 is prime is 91 (91 + 30 = 121 = 11^2; and 91 - 30 = 61 is prime), so a(6) = 91.
MATHEMATICA
a = 1; Print[a]; Do[k = a + 1; While[ !(PrimeQ[k - a] && IntegerQ[Sqrt[k + a]]), k++ ]; a = k; Print[a], {n, 1, 30}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ryan Propper, Aug 27 2005
EXTENSIONS
More terms from Robert G. Wilson v, Sep 28 2005
STATUS
approved