Number of times n = x^2 + y^2 + z^2 + w^2 with x + y + z + w a square and with (x,y,z,w) integers and |x| <= |y| <= |z| <= |w|.
1, 1, 2, 3, 7, 1, 3, 4, 3, 2, 7, 1, 5, 4, 3, 3, 11, 1, 8, 3, 5, 5, 5, 3, 4, 4, 9, 5, 6, 2, 5, 5, 2, 7, 10, 4, 9, 4, 7, 4, 8, 3, 8, 9, 4, 7, 4, 5, 8, 5, 10, 5, 6, 6, 10, 7, 3, 7, 13, 5, 4, 7, 5, 12, 7, 5, 13, 6, 8, 6, 10, 5, 9, 11, 11, 8, 11, 7, 9, 5, 8, 7, 13, 8
0
Sun and Sun prove that all terms of this sequence are positive. Compare with S000883, which does not have the “x + y + z + w a square” requirement.
T. D. Noe, Plot of 10000 terms
T. D. Noe, Table of 10000 terms
Yu-Chen Sun and Zhi-Wei Sun, Two refinements of Lagrange's four-square theorem, arxiv 1605.03074 (May 10 2016)
(Mma) lim = 10; nn = (lim+1)^2; t = Table[0, {nn}]; Do[n = x^2 + y^2 + z^2 + w^2; If[n < nn && IntegerQ[Sqrt[x + y + z + w]], t[[n+1]]++], {x, -lim, lim}, {y, -Abs[x], Abs[x]}, {z, -Abs[y], Abs[y]}, {w, -Abs[z], Abs[z]}]; t
Cf. A002635 (partitions into 4 squares), S000883-S000890.
nonn,nice
T. D. Noe, May 11 2016