This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A261904 Largest x such that n can be written as n = x^2 + y^2 + z^2 with x >= y >= z >= 0, or -1 if no such x exists. 4
 0, 1, 1, 1, 2, 2, 2, -1, 2, 3, 3, 3, 2, 3, 3, -1, 4, 4, 4, 3, 4, 4, 3, -1, 4, 5, 5, 5, -1, 5, 5, -1, 4, 5, 5, 5, 6, 6, 6, -1, 6, 6, 5, 5, 6, 6, 6, -1, 4, 7, 7, 7, 6, 7, 7, -1, 6, 7, 7, 7, -1, 6, 7, -1, 8, 8, 8, 7, 8, 8, 6, -1, 8, 8, 8, 7, 6, 8, 7, -1, 8, 9, 9 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,5 COMMENTS a(n) = -1 iff n is in A004215, a(n) >= 0 iff n is in A000378. Somehow maximizing x seems like the right thing to do (since it is natural to try a greedy algorithm first). If we minimize x we get A261915. LINKS David Consiglio, Jr., Table of n, a(n) for n = 0..10000 David Consiglio, Jr., Python Program EXAMPLE Tabls showing initial values of n,x,y,z: 0 0 0 0 1 1 0 0 2 1 1 0 3 1 1 1 4 2 0 0 5 2 1 0 6 2 1 1 7 -1 -1 -1 8 2 2 0 9 3 0 0 10 3 1 0 11 3 1 1 12 2 2 2 13 3 2 0 14 3 2 1 15 -1 -1 -1 16 4 0 0 17 4 1 0 18 4 1 1 19 3 3 1 20 4 2 0 ... CROSSREFS Cf. A000378, A004215, A005875, A261915. Analogs for 4 squares: A178786 and A122921. Sequence in context: A262982 A205011 A130790 * A297030 A266348 A179647 Adjacent sequences:  A261901 A261902 A261903 * A261905 A261906 A261907 KEYWORD sign AUTHOR N. J. A. Sloane, Sep 08 2015 EXTENSIONS More terms from David Consiglio, Jr., Sep 08 2015 STATUS approved

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

Last modified April 26 08:35 EDT 2019. Contains 322472 sequences. (Running on oeis4.)