Number of ways that n can be written as the sum of three positive squares and a prime.
0, 0, 0, 0, 1, 1, 0, 4, 3, 1, 6, 3, 6, 8, 1, 13, 10, 3, 13, 10, 12, 13, 13, 18, 16, 16, 12, 21, 23, 13, 25, 29, 21, 23, 25, 21, 36, 31, 15, 47, 31, 18, 46, 32, 36, 44, 36, 45, 46, 33, 37, 57, 47, 36, 53, 56, 51, 61, 56, 42, 70, 55, 39, 89, 56, 45, 82, 61, 63, 74
1
T. D. Noe, Plot of 1000 terms
T. D. Noe, Table of 1000 terms
(Mma) nn = 10; s = Select[Sort[Flatten[Table[x^2 + y^2 + z^2 + p, {x, nn}, {y, nn}, {z, nn}, {p, Prime[Range[PrimePi[nn^2]]]}]]], # <= nn^2 &]; t = Table[0, {nn^2}]; s = Tally[s]; Do[t[[i[[1]]]] = i[[2]], {i, s}]; t
Cf. S000125-S000136 (2 to 4 squares), A002471, A064272 (1 square).
nonn
T. D. Noe, Jul 11 2014