%I #14 Mar 03 2018 12:43:06
%S 0,1,2,1,1,1,2,1,2,1,2,3,1,1,3,1,3,4,2,2,4,1,2,1,1,2,4,3,1,1,2,1,6,2,
%T 2,2,5,1,4,1,2,6,3,3,3,1,2,3,4,3,3,2,4,2,2,1,7,3,1,4,1,2,8,1,3,7,3,4,
%U 6,3,4,4,6,5,3,2,4,3,1,2
%N Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x >= y >= 0 <= z <= w such that x + 63*y = 2^(2k+1) for some nonnegative integer k.
%C Conjecture: (i) a(n) > 0 for all n > 1, and a(n) = 1 only for n = 5, 13, 25, 29, 59, 61, 91, 95, 101, 103, 211, 247, 2^k (k = 1,2,...), 4^k*79 (k = 0,1,2,...), 2^(2k+1)*m (k = 0,1,2,... and m = 3, 5, 7, 11, 15, 19, 23).
%C (ii) Let r be 0 or 1, and let n > r. Then n^2 can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x + 15*y = 2^(2k+r) for some k = 0,1,2,.... Also, we can write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that 16*x - 15*y = 2^(2k+r) for some k = 0,1,2,....
%C We have verified that a(n) > 0 for all n = 2..10^7.
%C See also A299924 and A300219 for similar conjectures.
%H Zhi-Wei Sun, <a href="/A300356/b300356.txt">Table of n, a(n) for n = 1..6000</a>
%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.
%H Zhi-Wei Sun, <a href="http://arxiv.org/abs/1701.05868">Restricted sums of four squares</a>, arXiv:1701.05868 [math.NT], 2017-2018.
%e a(5) = 1 sine 5^2 = 2^2 + 2^2 + 1^2 + 4^2 with 2 + 63*2 = 2^7.
%e a(6) = 1 since 6^2 = 2^2 + 0^2 + 4^2 + 4^2 with 2 + 63*0 = 2^1.
%e a(10) = 1 since 10^2 = 8^2 + 0^2 + 0^2 + 6^2 with 8 + 63*0 = 2^3.
%e a(13) = 1 since 13^2 = 8^2 + 8^2 + 4^2 + 5^2 with 8 + 63*8 = 2^9.
%e a(59) = 1 since 59^2 = 32^2 + 32^2 + 8^2 + 37^2 with 32 + 63*32 = 2^11.
%e a(85) = 2 since 85^2 = 32^2 + 0^2 + 24^2 + 75^2 = 32^2 + 0^2 + 51^2 + 60^2 with 32 + 63*0 = 2^5.
%e a(86) = 3 since 86^2 = 65^2 + 1^2 + 19^2 + 53^2 = 65^2 + 1^2 + 31^2 + 47^2 = 71^2 + 7^2 + 25^2 + 41^2 with 65 + 63*1 = 2^7 and 71 + 63*7 = 2^9.
%e a(247) = 1 since 247^2 = 2^2 + 2^2 + 76^2 + 235^2 with 2 + 63*2 = 2^7.
%t SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]
%t Pow[n_]:=Pow[n]=IntegerQ[Log[4,n]]
%t tab={};Do[r=0;Do[If[SQ[n^2-x^2-y^2-z^2]&&Pow[(x+63y)/2],r=r+1],{x,0,n},{y,0,Min[x,Sqrt[n^2-x^2]]},{z,0,Sqrt[(n^2-x^2-y^2)/2]}];tab=Append[tab,r],{n,1,80}];Print[tab]
%Y Cf. A000290, A000118, A271518, A279612, A281976, A299924, A300219.
%K nonn
%O 1,3
%A _Zhi-Wei Sun_, Mar 03 2018