A300667 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and z <= w such that 3*x or y is a square and x + 2*y is also a square.
1, 2, 2, 1, 2, 4, 3, 1, 2, 4, 3, 1, 1, 3, 3, 1, 2, 5, 6, 3, 4, 5, 4, 2, 2, 5, 6, 3, 1, 4, 5, 2, 2, 4, 5, 3, 4, 4, 3, 1, 2, 6, 5, 3, 2, 4, 3, 1, 1, 3, 7, 4, 4, 5, 7, 4, 2, 4, 5, 3, 1, 2, 3, 3, 2, 6, 8, 4, 7, 7, 5, 1, 3, 4, 4, 4, 3, 4, 3, 3, 4
Offset: 0
Keywords
Examples
a(12) = 1 since 12 = 0^2 + 2^2 + 2^2 + 2^2 with 3*0 = 0^2 and 0 + 2*2 = 2^2. a(39) = 1 since 39 = 2^2 + 1^2 + 3^2 + 5^2 with 1 = 1^2 and 2 + 2*1 = 2^2. a(172) = 1 since 172 = 7^2 + 1^2 + 1^2 + 11^2 with 1 = 1^2 and 7 + 2*1 = 3^2. a(232) = 1 since 232 = 0^2 + 0^2 + 6^2 + 14^2 with 0 = 0^2 and 0 + 2*0 = 0^2. a(253) = 1 since 253 = 8^2 + 4^2 + 2^2 + 13^2 with 4 = 2^2 and 8 + 2*4 = 4^2. a(263) = 1 since 263 = 3^2 + 3^2 + 7^2 + 14^2 with 3*3 = 3^2 and 3 + 2*3 = 3^2. a(515) = 1 since 515 = 1^2 + 0^2 + 15^2 + 17^2 with 0 = 0^2 and 1 + 2*0 = 1^2.
References
- Yu-Chen Sun and Zhi-Wei Sun, Some variants of Lagrange's four squares theorem, Acta Arith. 183(2018), 339-356.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 0..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-2018.
- Yu-Chen Sun and Zhi-Wei Sun, Some variants of Lagrange's four squares theorem, arXiv:1605.03074 [math.NT], 2016-2018.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; tab={};Do[r=0;Do[If[(SQ[3(m^2-2y)]||SQ[y])&&SQ[n-(m^2-2y)^2-y^2-z^2],r=r+1],{m,0,(5n)^(1/4)},{y,0,Min[m^2/2,Sqrt[n]]},{z,0,Sqrt[Max[0,(n-(m^2-2y)^2-y^2)/2]]}];tab=Append[tab,r],{n,0,80}];Print[tab]
-
PARI
A300667(n)=sum(x=0,sqrtint(n),sum(y=0,sqrtint(n-x^2),if(issquare(x+2*y)&&(issquare(y)||issquare(3*x)),if(n>x^2+y^2,A000161(n-x^2-y^2),1)))) \\ M. F. Hasler, Mar 11 2018
Comments