OFFSET
1,2
COMMENTS
Conjecture: (i) a(n) > 0 for all n > 0, and a(n) = 1 only for n = 39, 47, 95, 543, 4^k*m (k = 0,1,2,... and m = 1, 3, 7, 15, 23, 135, 183).
(ii) Any natural number can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that (a*x+b*y)^2 + (c*z)^2 is a square, whenever (a,b,c) is among the triples (1,2,4), (1,2,12), (1,4,8), (1,4,12), (1,10,20), (1,15,12), (2,7,20), (2,7,60), (2,21,60), (3,3,4), (3,3,40), (3,4,12), (3,5,60), (3,6,20), (3,9,20), (3,11,24), (3,12,8), (3,27,20), (3,27,56), (3,29,60), (3,30,28), (3,45,20), (4,4,3), (4,4,5), (4,4,9), (4,4,15), (4,8,5), (4,12,15), (4,12,21), (4,12,45), (4,16,45), (4,19,40), (4,20,21), (4,36,21), (4,36,33), (4,52,63), (5,5,8), (5,5,12), (5,5,24), (5,6,12), (5,8,24), (5,10,4), (5,15,24), (5,25,16), (5,30,12), (5,35,48), (5,40,24), (6,10,15), (6,15,28), (6,45,28), (7,7,20), (7,7,24), (7,21,12), (7,63,36), (8,8,15), (8,12,45), (8,16,35), (8,16,45), (8,32,15), (8,32,21), (8,48,45), (9,9,40), (9,18,28), (9,27,16), (9,45,20), (10,15,12), (10,25,28), (11,11,60), (12,12,5), (12,12,35), (12,20,63), (12,60,55).
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 [math.GM], 2016.
EXAMPLE
a(1) = 1 since 1 = 0^2 + 1^2 + 0^2 + 0^2 with 0 < 1 > 0 and (0+1)^2 + (4*0)^2 = 1^2.
a(3) = 1 since 3 = 1^2 + 1^2 + 0^2 + 1^2 with 1 = 1 > 0 and (1+1)^2 + (4*0)^2 = 2^2.
a(7) = 1 since 7 = 1^2 + 2^2 + 1^2 + 1^2 with 1 < 2 > 1 and (1+2)^2 + (4*1)^2 = 5^2.
a(15) = 1 since 15 = 1^2 + 2^2 + 1^2 + 3^2 with 1 < 2 > 1 and (1+2)^2 + (4*1)^2 = 5^2.
a(23) = 1 since 23 = 3^2 + 3^2 + 2^2 + 1^2 with 3 = 3 > 2 and (3+3)^2 + (4*2)^2 = 10^2.
a(39) = 1 since 39 = 1^2 + 5^2 + 2^2 + 3^2 with 1 < 5 > 2 and (1+5)^2 + (4*2)^2 = 10^2.
a(47) = 1 since 47 = 3^2 + 3^2 + 2^2 + 5^2 with 3 = 3 > 2 and (3+3)^2 + (4*2)^2 = 10^2.
a(95) = 1 since 95 = 3^2 + 7^2 + 6^2 + 1^2 with 3 < 7 > 6 and (3+7)^2 + (4*6)^2 = 26^2.
a(135) = 1 since 135 = 3^2 + 6^2 + 3^2 + 9^2 with 3 < 6 > 3 and (3+6)^2 + (4*3)^2 = 15^2.
a(183) = 1 since 183 = 2^2 + 7^2 + 3^2 + 11^2 with 2 < 7 > 3 and (2+7)^2 + (4*3)^2 = 15^2.
a(543) = 1 since 543 = 2^2 + 13^2 + 9^2 + 17^2 with 2 < 13 > 9 and (2+13)^2 + (4*9)^2 = 39^2.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]
Do[r=0; Do[If[SQ[n-x^2-y^2-z^2]&&SQ[(x+y)^2+16*z^2], r=r+1], {x, 0, Sqrt[n/2]}, {y, x, Sqrt[n-x^2]}, {z, 0, Min[y-1, Sqrt[n-x^2-y^2]]}]; Print[n, " ", r]; Continue, {n, 1, 80}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, May 15 2016
EXTENSIONS
All statements in examples checked by Rick L. Shepherd, May 29 2016
STATUS
approved