%I #7 Feb 03 2017 02:57:12
%S 1,2,3,5,4,1,5,2,3,4,5,1,3,1,4,2,2,1,10,5,2,2,6,1,7,7,5,7,4,3,7,1,3,
%T 12,9,4,2,2,5,3,5,5,9,10,1,5,5,1,5,3,6,8,2,4,9,4,4,8,5,3,3,4,5,3,4,5,
%U 10,4,1,5,7,1,7,10,6,8,3,2,10,2,1
%N Number of ways to write n as w^2 + x^2 + y^2 + z^2 with w and w + x + y + z both squares, where w,x,y,z are integers with |x| <= |y| <= |z|.
%C Conjecture: (i) a(n) > 0 for all n = 0,1,2,....
%C (ii) Any nonnegative integer n can be written as x^2 + y^2 + z^2 + w^2 with x - y + z and z + w both squares, where x,w are integers and y,z are nonnegative integers.
%C The author has proved that every n = 0,1,2,... is the sum of a fourth power and three squares. Y.-C. Sun and the author have shown that any nonnegative integer can be written as w^2 + x^2 + y^2 + z^2 with w,x,y,z integers such that w + x + y + z is a square.
%H Zhi-Wei Sun, <a href="/A281941/b281941.txt">Table of n, a(n) for n = 0..10000</a>
%H Yu-Chen Sun and Zhi-Wei Sun, <a href="http://arxiv.org/abs/1605.03074">Some refinements of Lagrange's four-square theorem</a>, arXiv:1605.03074 [math.NT], 2016-2017.
%H Zhi-Wei Sun, <a href="http://dx.doi.org/10.1016/j.jnt.2016.11.008">Refining Lagrange's four-square theorem</a>, J. Number Theory 175(2017), 167-190.
%e a(5) = 1 since 5 = 0^2 + 0^2 + (-1)^2 + 2^2 with 0 = 0^2 and 0 + 0 + (-1) + 2 = 1^2.
%e a(23) = 1 since 23 = 1^2 + 2^2 + 3^2 + 3^2 with 1 = 1^2 and 1 + 2 + 3 + 3 = 3^2.
%e a(47) = 1 since 47 = 1^2 + (-1)^2 + 3^2 + 6^2 with 1 = 1^2 and 1 + (-1) + 3 + 6 = 3^2.
%e a(157) = 1 since 157 = 4^2 + (-2)^2 + (-4)^2 + 11^2 with 4 = 2^2 and 4 + (-2) + (-4) + 11 = 3^2.
%e a(284) = 1 since 284 = 9^2 + 3^2 + 5^2 + (-13)^2 with 9 = 3^2 and 9 + 3 + 5 + (-13) = 2^2.
%e a(628) = 1 since 628 = 9^2 + (-5)^2 + (-9)^2 + 21^2 with 9 = 3^2 and 9 + (-5) + (-9) + 21 = 4^2.
%t SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
%t Do[r=0;Do[If[SQ[n-x^4-y^2-z^2]&&SQ[x^2+(-1)^i*y+(-1)^j*z+(-1)^k*Sqrt[n-x^4-y^2-z^2]],r=r+1],{x,0,n^(1/4)},{y,0,Sqrt[(n-x^4)/3]},{i,0,Min[y,1]},{z,y,Sqrt[(n-x^4-y^2)/2]},{j,0,Min[z,1]},{k,0,Min[Sqrt[n-x^4-y^2-z^2],1]}];Print[n," ",r];Continue,{n,0,80}]
%Y Cf. A000118, A000290, A270969, A272620, A281939.
%K nonn
%O 0,2
%A _Zhi-Wei Sun_, Feb 02 2017