OFFSET
0,8
COMMENTS
The sequence is well defined as every nonnegative integer can be represented as a sum of four squares in at least one way.
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
Rémy Sigrist, Colored scatterplot of the first 20000 terms (where the color is function of the parity of n)
Rémy Sigrist, C program for A307510
Wikipedia, Lagrange's four-square theorem
FORMULA
a(n) = 0 iff n belongs to A000534.
a(n) <= (n/4)^2, with equality if and only if n is an even square. - Robert Israel, Apr 15 2019
EXAMPLE
For n = 34:
- 34 can be expressed in 4 ways as a sum of four squares:
i^2 + j^2 + k^2 + l^2 i*j*k*l
--------------------- -------
0^2 + 0^2 + 3^2 + 5^2 0
0^2 + 3^2 + 3^2 + 4^2 0
1^2 + 1^2 + 4^2 + 4^2 16
1^2 + 2^2 + 2^2 + 5^2 20
- a(34) = max(0, 16, 20) = 20.
MAPLE
g:= proc(n, k) option remember; local a;
if k = 1 then if issqr(n) then return sqrt(n) else return -infinity fi fi;
max(0, seq(a*procname(n-a^2, k-1), a=1..floor(sqrt(n))))
end proc:
seq(g(n, 4), n=0..100); # Robert Israel, Apr 15 2019
MATHEMATICA
Array[Max[Times @@ # & /@ PowersRepresentations[#, 4, 2]] &, 68, 0] (* Michael De Vlieger, Apr 13 2019 *)
PROG
(C) See Links section.
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Rémy Sigrist, Apr 11 2019
STATUS
approved