OFFSET
1,2
COMMENTS
The maximum between a(n) and the n-th integer appears to be +-6. In the first 10k terms, the distribution of differences, from -6 to 6 is: 27, 140, 1350, 7002, 1282, 168, 31. Therefore I conjecture that Lim_{n->infinity} a(n) = n.
EXAMPLE
1^2 + 8^2 = 65 composite, 8^2 + 9^2 = 145 composite, 9^2 + 2^2 = 85 composite.
MATHEMATICA
f[s_List] := Block[{k = If[ OddQ[ s[[-1]]], 2, 3], m = s[[-1]]}, While[a = k^2 + m^2; MemberQ[s, k] || PrimeQ[a] || EvenQ[a], k += 2]; Append[s, k]]; Nest[f, {1}, 70] (* Robert G. Wilson v, Jan 02 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Dec 29 2011
STATUS
approved