A271721 Number of ordered ways to write n as x^2 + y^2 + z^2 + w^2 with x >= y >= z >= 0, x > 0 and w >= z such that (x-y)*(w-z) is a square.
1, 2, 1, 2, 1, 2, 2, 2, 2, 3, 1, 3, 2, 2, 1, 2, 4, 5, 3, 3, 3, 2, 1, 2, 3, 5, 4, 5, 2, 2, 4, 2, 3, 5, 1, 4, 4, 5, 3, 3, 4, 5, 4, 3, 4, 2, 2, 3, 3, 5, 3, 8, 4, 6, 3, 2, 4, 6, 3, 3, 4, 4, 5, 2, 3, 7, 6, 7, 2, 3, 2, 5, 6, 8, 3, 7, 3, 2, 2, 3, 6, 11, 5, 8, 5, 8, 4, 2, 3, 8, 4, 5, 5, 3, 1, 2, 9, 10, 5, 8
Offset: 1
Keywords
Examples
a(3) = 1 since 3 = 1^2 + 1^2 + 0^2 + 0^2 with 1 = 1 > 0 = 0 and (1-1)*(0-0) = 0^2. a(5) = 1 since 5 = 2^2 + 1^2 + 0^2 + 0^2 with 2 > 1 > 0 = 0 and (2-1)*(0-0) = 0^2. a(11) = 1 since 11 = 1^2 + 1^2 + 0^2 + 3^2 with 1 = 1 > 0 < 3 and (1-1)*(3-0) = 0^2. a(14) = 2 since 14 = 3^2 + 1^2 + 0^2 + 2^2 with 3 > 1 > 0 < 2 and (3-1)*(2-0) = 2^2, and also 14 = 3^2 + 2^2 + 0^2 + 1^2 with 3 > 2 > 0 < 1 and (3-2)*(1-0) = 1^2. a(15) = 1 since 15 = 3^2 + 2^2 + 1^2 + 1^2 with 3 > 2 > 1 = 1 and (3-2)*(1-1) = 0^2. a(23) = 1 since 23 = 3^2 + 3^2 + 1^2 + 2^2 with 3 = 3 > 1 < 2 and (3-3)*(2-1) = 0^2. a(35) = 1 since 35 = 3^2 + 3^2 + 1^2 + 4^2 with 3 = 3 > 1 < 4 and (3-3)*(4-1) = 0^2. a(95) = 1 since 95 = 5^2 + 5^2 + 3^2 + 6^2 with 5 = 5 > 3 < 6 and (5-5)*(6-3) = 0^2. a(190) = 1 since 190 = 13^2 + 4^2 + 1^2 + 2^2 with 13 > 4 > 1 < 2 and (13-4)*(2-1) = 3^2.
References
- L. E. Dickson, Integers represented by positive ternary quadratic forms, Bull. Amer. Math. Soc. 33(1927), 63-70.
- L. E. Dickson, Modern Elementary Theory of Numbers, University of Chicago Press, Chicago, 1939, pp. 112-113.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, Refining Lagrange's four-square theorem, arXiv:1604.06723, 2016.
Crossrefs
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]] Do[r=0;Do[If[SQ[n-x^2-y^2-z^2]&&SQ[(Sqrt[n-x^2-y^2-z^2]-z)*(x-y)],r=r+1],{z,0,Sqrt[n/4]},{y,z,Sqrt[(n-z^2)/2]},{x,Max[1,y],Sqrt[(n-y^2-2z^2)]}];Print[n," ",r];Continue,{n,1,100}]
Comments