login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A307531 a(n) is the greatest sum i + j + k + l where i^2 + j^2 + k^2 + l^2 = n and 0 <= i <= j <= k <= l. 3
0, 1, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8, 7, 8, 9, 8, 9, 8, 9, 10, 9, 10, 9, 10, 11, 8, 11, 10, 11, 12, 11, 12, 11, 12, 11, 12, 13, 12, 13, 12, 13, 12, 13, 14, 13, 14, 13, 14, 13, 12, 15, 14, 15, 14, 15, 14, 15, 16, 15, 16, 15, 16, 15, 16, 15 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
The sequence is well defined as every nonnegative integer can be represented as a sum of four squares in at least one way.
It appears that a(n^2) = 2*n if n is even and 2*n-1 if n is odd. - Robert Israel, Apr 14 2019
LINKS
Rémy Sigrist, C program for A307531
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 8
0^2 + 3^2 + 3^2 + 4^2 10
1^2 + 1^2 + 4^2 + 4^2 10
1^2 + 2^2 + 2^2 + 5^2 10
- a(34) = max(8, 10) = 10.
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(seq(a+procname(n-a^2, k-1), a=0..floor(sqrt(n))))
end proc:
seq(g(n, 4), n=0..100); # Robert Israel, Apr 14 2019
MATHEMATICA
Array[Max[Total /@ PowersRepresentations[#, 4, 2]] &, 68, 0] (* Michael De Vlieger, Apr 13 2019 *)
PROG
(C) See Links section.
CROSSREFS
See A307510 for the multiplicative variant.
Sequence in context: A114524 A058033 A216197 * A125619 A349946 A262519
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Apr 13 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 09:48 EDT 2024. Contains 371905 sequences. (Running on oeis4.)