A271775 Number of ordered ways to write n as x^2 + y^2 + z^2 + w^2 (x >= y >= z <= w) with x - y a square, where w,x,y,z are nonnegative integers.
1, 2, 2, 1, 2, 2, 3, 2, 1, 4, 3, 1, 2, 2, 3, 2, 3, 5, 5, 3, 2, 3, 4, 3, 1, 4, 6, 5, 4, 3, 5, 3, 2, 5, 4, 3, 5, 4, 5, 2, 2, 8, 9, 5, 4, 8, 2, 1, 3, 5, 9, 7, 6, 2, 7, 4, 1, 5, 6, 6, 4, 5, 7, 8, 2, 6, 12, 7, 5, 4, 7
Offset: 0
Keywords
Examples
a(3) = 1 since 3 = 1^2 + 1^2 + 0^2 + 1^2 with 1 = 1 > 0 < 1 and 1 - 1 = 0^2. a(7) = 1 since 7 = 1^2 + 1^2 + 1^2 + 2^2 with 1 = 1 = 1 < 2 and 1 - 1 = 0^2. a(8) = 1 since 8 = 2^2 + 2^2 + 0^2 + 0^2 with 2 = 2 > 0 = 0 and 2 - 2 = 0^2. a(11) = 1 since 11 = 1^2 + 1^2 + 0^2 + 3^2 with 1 = 1 > 0 < 3 and 1 - 1 = 0^2. a(24) = 1 since 24 = 2^2 + 2^2 + 0^2 + 4^2 with 2 = 2 > 0 < 4 and 2 - 2 = 0^2. a(47) = 1 since 47 = 3^2 + 3^2 + 2^2 + 5^2 with 3 = 3 > 2 < 5 and 3 - 3 = 0^2. a(53) = 2 since 53 = 3^2 + 2^2 + 2^2 + 6^2 with 3 > 2 = 2 < 6 and 3 - 2 = 1^2, and also 53 = 6^2 + 2^2 + 2^2 + 3^2 with 6 > 2 = 2 < 3 and 6 - 2 = 2^2. a(56) = 1 since 56 = 6^2 + 2^2 + 0^2 + 4^2 with 6 > 2 > 0 < 4 and 6 - 2 = 2^2. a(120) = 1 since 120 = 8^2 + 4^2 + 2^2 + 6^2 with 8 > 4 > 2 < 6 and 8 - 4 = 2^2. a(632) = 1 since 632 = 16^2 + 12^2 + 6^2 + 14^2 with 16 > 12 > 6 < 14 and 16 - 12 = 2^2.
References
- 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 = 0..10000
- Zhi-Wei Sun, On universal sums of polygonal numbers, arXiv:0905.0635 [math.NT], 2009-2015; Sci. China Math. 58(2015), 1367-1396.
- Zhi-Wei Sun, Refining Lagrange's four-square theorem, arXiv:1604.06723 [math.GM], 2016.
Crossrefs
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]] Do[r=0;Do[If[SQ[x-y]&&SQ[n-x^2-y^2-z^2],r=r+1],{z,0,Sqrt[n/4]},{y,z,Sqrt[(n-z^2)/2]},{x,y,Sqrt[(n-y^2-z^2)]}];Print[n," ",r];Continue,{n,0,70}]
Comments