OFFSET
1,28
COMMENTS
The old entry with this sequence number was a duplicate of A034836.
From Wolfdieter Lang, Mar 25 2013: (Start)
a(n) = 0 if n has no partition with four parts, each a (nonzero) square, and the parts have no common factor > 1.
n is not representable as a primitive sum of four nonzero squares.
If n' has a representation [s(1),s(2),s(3),s(4)] with 1 <= s(1) <= s(2) <= s(3) <= s(4) and sum(s(j)^2,j=1..4) = n', then [k*s(1),k*s(2),k*s(3),k*s(4)] is a representation of n := k^2*n'. Therefore, only primitive representations with gcd(s(1),s(2),s(3),s(4)) = 1 are here considered.
See A025428(n) for the multiplicity of the representations of n as a sum of four nonzero squares.
For the n values with a(n) not zero (primitively representable as a sum of four nonzero squares) see A222949. (End)
LINKS
N. J. A. Sloane, Vinay Vaishampayan and Alois P. Heinz, Table of n, a(n) for n = 1..10000 (terms n = 1..1024 from N. J. A. Sloane and Vinay Vaishampayan)
FORMULA
If a(n) > 0 then 8 does not divide n.
a(n) = k if there are k different quadruples [s(1),s(2),s(3),s(4)] with 1 <= s(1) <= s(2) <= s(3) <= s(4), gcd(s(1),s(2),s(3),s(4)) = 1 and sum(s(j)^2,j=1..4) = n. If there is no such quadruple then a(n) = 0. - Wolfdieter Lang, Mar 25 2013
EXAMPLE
The solutions (if any) for n <= 20 are as follows:
n = 1:
n = 2:
n = 3:
n = 4: 1 1 1 1
n = 5:
n = 6:
n = 7: 1 1 1 2
n = 8:
n = 9:
n = 10: 1 1 2 2
n = 11:
n = 12: 1 1 1 3
n = 13: 1 2 2 2
n = 14:
n = 15: 1 1 2 3
n = 16:
n = 17:
n = 18: 1 2 2 3
n = 19: 1 1 1 4
n = 20: 1 1 3 3
From Wolfdieter Lang, Mar 25 2013: (Start)
a(16) = 0 because 16 is not a primitive sum of four nonzero squares. The representation [2,2,2,2] of 16 is not primitive.
a(40) = 0 because the only representation as sum of four nonzero squares (A025428(4) = 1) is [2,2,4,4], but this is not primitive.
a(28) = 2 because the two primitive representations of 28 are
[1, 1, 1, 5] and [1, 3, 3, 3]. [2, 2, 2, 4] = 2*[1, 1, 1, 2] is not primitive due to 28 = 2^2*7. (End)
MAPLE
b:= proc(n, i, g, t) option remember; `if`(n=0,
`if`(g=1 and t=0, 1, 0), `if`(i<1 or t=0 or i^2*t<n, 0,
b(n, i-1, g, t)+ `if`(i^2>n, 0, b(n-i^2, i, igcd(g, i), t-1))))
end:
a:= n-> `if`(n<4, 0, b(n, isqrt(n-3), 0, 4)):
seq(a(n), n=1..120); # Alois P. Heinz, Apr 02 2013
MATHEMATICA
Clear[b]; b[n_, i_, g_, t_] := b[n, i, g, t] = If[n == 0, If[g == 1 && t == 0, 1, 0], If[i < 1 || t == 0 || i^2*t < n, 0, b[n, i-1, g, t] + If[i^2 > n, 0, b[n-i^2, i, GCD[g, i], t-1]]]]; a[n_] := If[n < 4, 0, b[n, Sqrt[n-3] // Floor, 0, 4]]; Table[a[n], {n, 1, 99}] (* Jean-François Alcover, Apr 05 2013, translated from Alois P. Heinz's Maple program *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane and Vinay Vaishampayan, Oct 22 2008
STATUS
approved