Number of times n can be written as a square or the sum of a square and a prime.
1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 0, 3, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 1, 3, 1, 1, 1, 3, 2, 2, 2, 1, 3, 2, 0, 2, 2, 1, 4, 2, 1, 3, 2, 2, 2, 2, 1, 4, 2, 2, 1, 2, 2, 3, 3, 1, 3, 2, 0, 3, 2, 1, 4, 2, 1, 2, 3, 3, 4, 2, 1, 3, 3, 2, 1, 3, 1, 4, 2, 2, 3, 2, 1, 6, 3, 0, 3
0
See S000582 for the n where records occur.
T. D. Noe, Plot of 10001 terms
T. D. Noe, Table of 10001 terms
(Mma) lim = 100; ps = Join[{0}, Prime[Range[PrimePi[lim]]]]; sq = Range[0, Sqrt[lim]]^2; s = Select[Flatten[Table[i + j, {i, ps}, {j, sq}]], # <= lim &]; z = Complement[Range[lim], Union[s]]; za = Table[{i, 0}, {i, z}]; Transpose[Sort[Join[za, Tally[s]]]][[2]]
Cf. A020495 (where zeros are), S000582, S000583.
nonn
T. D. Noe, Apr 20 2015