login
Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x + 2*y a power of four (including 4^0 = 1), where x, y, z, w are nonnegative integers with z <= w.
1

%I #27 Oct 31 2020 17:50:48

%S 1,1,1,1,3,3,1,1,3,2,1,1,2,3,1,1,3,3,1,2,4,2,1,2,2,3,1,0,3,4,1,1,3,2,

%T 1,2,2,2,1,1,5,3,0,1,3,2,0,1,1,3,2,2,5,6,3,3,5,2,1,1,4,5,3,1,6,8,0,4,

%U 9,5,2,3,4,4,1,1,7,6,3,3

%N Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x + 2*y a power of four (including 4^0 = 1), where x, y, z, w are nonnegative integers with z <= w.

%C Conjecture 1: a(n) > 0 if n is neither of the form 4^k*(4*m+3) (k>=0, m>=0) nor of the form 2^(4*k+3)*101 (k>=0). In particular, a(n^2) > 0 and a(2*n^2) > 0 for all n > 0.

%C Conjecture 2: Any positive integer not of the form 16^k*m (k>=0, m = 1, 25, 46, 88) can be written as x^2 + y^2 + z^2 + w^2 (x,y,z,w >= 0) such that 2*x - y = 4^a for some nonnegative integer a.

%C Conjecture 3: Any positive integer of the form 2^k*(2*m+1) (k>=0, m>=0) with k == floor(m/2) (mod 2) (such as positive squares) can be written as x^2 + y^2 + z^2 + w^2 (x,y,z,w >= 0) such that x + 3*y = 4^a for some nonnegative integer a.

%H Zhi-Wei Sun, <a href="/A337743/b337743.txt">Table of n, a(n) for n = 1..10000</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. See also <a href="http://arxiv.org/abs/1604.06723">arXiv:1604.06723 [math.NT]</a>.

%H Zhi-Wei Sun, <a href="https://doi.org/10.1142/S1793042119501045">Restricted sums of four squares</a>, Int. J. Number Theory 15(2019), 1863-1893. See also <a href="http://arxiv.org/abs/1701.05868">arXiv:1701.05868 [math.NT]</a>.

%H Zhi-Wei Sun, <a href="http://arxiv.org/abs/2010.05775">Sums of four squares with certain restrictions</a>, arXiv:2010.05775 [math.NT], 2020.

%e a(7) = 1, and 7 = 2^2 + 1^2 + 1^2 + 1^2 with 2 + 2*1 = 4.

%e a(35) = 1, and 35 = 1^2 + 0^2 + 3^2 + 5^2 with 1 + 2*0 = 4^0.

%e a(49) = 1, and 49 = 0^2 + 2^2 + 3^2 + 6^2 with 0 + 2*2 = 4.

%t SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];

%t PQ[n_]:=PQ[n]=n>0&&IntegerQ[Log[4,n]];

%t tab={};Do[r=0;Do[If[SQ[n-x^2-y^2-z^2]&&PQ[x+2y],r=r+1],{x,0,Sqrt[n]},{y,0,Sqrt[n-x^2]},{z,0,Sqrt[(n-x^2-y^2)/2]}];tab=Append[tab,r],{n,1,80}];tab

%Y Cf. A000118, A000290, A000302, A338094, A338095, A338096, A338103, A338119, A338121, A338162.

%K nonn

%O 1,5

%A _Zhi-Wei Sun_, Oct 30 2020