A281494 Number of ordered ways to write n as x^2 + y^2 + z^2 + w^2 with x + y + z + w = 2^(floor((ord_2(n)+1)/2)), where ord_2(n) is the 2-adic order of n, and x,y,z,w are integers with |x| <= |y| <= |z| <= |w|.
1, 1, 3, 5, 1, 2, 4, 1, 2, 4, 1, 6, 4, 1, 3, 5, 1, 4, 3, 3, 4, 4, 2, 2, 3, 2, 3, 8, 1, 3, 4, 1, 5, 5, 2, 4, 3, 2, 2, 4, 1, 7, 7, 2, 4, 3, 2, 6, 3, 3, 3, 9, 2, 5, 4, 1, 5, 4, 2, 6, 4, 3, 6, 5, 2, 5, 2, 2, 4, 6, 2, 4, 6, 4, 5, 6, 3, 4, 4, 3
Offset: 1
Keywords
Examples
a(1) = 1 since 1 = 0^2 + 0^2 + 0^2 + 1^2 with 0 + 0 + 0 + 1 = 1 =2^0 = 2^(floor((ord_2(1)+1)/2)). a(2) = 1 since 2 = 0^2 + 0^2 + 1^2 + 1^2 with 0 + 0 + 1 + 1 = 2 = 2^(floor((ord_2(2)+1)/2)). a(5) = 1 since 5 = 0^2 + 0^2 + (-1)^2 + 2^2 with 0 + 0 + (-1) + 2 = 1 = 2^0 = 2^(floor((ord_2(5)+1)/2)). a(6) = 2 since 6 = 0^2 + 1^2 + (-1)^2 + 2^2 = 0^2 + (-1)^2 + 1^2 + 2^2 with 0 + 1 + (-1) + 2 = 0 + (-1) + 1 + 2 = 2 = 2^(floor((ord_2(6)+1)/2)). a(11) = 1 since 11 = 0^2 + (-1)^2 + (-1)^2 + 3^2 with 0 + (-1) + (-1) + 3 = 1 = 2^0 = 2^(floor((ord_2(11)+1)/2)). a(14) = 1 since 14 = 0^2 + 1^2 + (-2)^2 + 3^2 with 0 + 1 + (-2) + 3 = 2 = 2^(floor((ord_2(14)+1)/2)). a(17) = 1 since 17 = 0^2 + 2^2 + 2^2 + (-3)^2 with 0 + 2 + 2 + (-3) = 1 = 2^0 = 2^(floor((ord_2(17)+1)/2)). a(41) = 1 since 41 = 0^2 + 0^2 + (-4)^2 + 5^2 with 0 + 0 + (-4) + 5 = 1 = 2^0 = 2^(floor((ord_2(41)+1)/2)). a(101) = 1 since 101 = 0^2 + (-1)^2 + (-6)^2 + 8^2 with 0 + (-1) + (-6) + 8 = 1 = 2^0 = 2^(floor((ord_2(101)+1)/2)). a(107) = 1 since 107 = (-1)^2 + (-3)^2 + (-4)^2 + 9^2 with (-1) + (-3) + (-4) + 9 = 1 = 2^0 = 2^(floor((ord_2(107)+1)/2)).
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
- Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; Ord[p_,n_]=Ord[p,n]=IntegerExponent[n,p]; Do[r=0;Do[If[SQ[n-x^2-y^2-z^2]&&((-1)^i*x+(-1)^j*y+(-1)^k*z+(-1)^s*Sqrt[n-x^2-y^2-z^2]==2^(Floor[(Ord[2,n]+1)/2])),r=r+1],{x,0,Sqrt[n/4]},{i,0,Min[x,1]},{y,x,Sqrt[(n-x^2)/3]},{j,0,Min[y,1]},{z,y,Sqrt[(n-x^2-y^2)/2]},{k,0,Min[z,1]},{s,0,Min[Sqrt[n-x^2-y^2-z^2],1]}]; Print[n," ",r];Continue,{n,1,80}]
Comments