cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A261904 #30 Sep 12 2015 14:53:18
%S A261904 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,
%T A261904 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,
%U A261904 8,8,8,7,8,8,6,-1,8,8,8,7,6,8,7,-1,8,9,9
%N 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.
%C A261904 a(n) = -1 iff n is in A004215, a(n) >= 0 iff n is in A000378.
%C A261904 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.
%H A261904 David Consiglio, Jr., <a href="/A261904/b261904.txt">Table of n, a(n) for n = 0..10000</a>
%H A261904 David Consiglio, Jr., <a href="/A261904/a261904.txt">Python Program</a>
%H A261904 <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>
%e A261904 Tabls showing initial values of n,x,y,z:
%e A261904 0 0 0 0
%e A261904 1 1 0 0
%e A261904 2 1 1 0
%e A261904 3 1 1 1
%e A261904 4 2 0 0
%e A261904 5 2 1 0
%e A261904 6 2 1 1
%e A261904 7 -1 -1 -1
%e A261904 8 2 2 0
%e A261904 9 3 0 0
%e A261904 10 3 1 0
%e A261904 11 3 1 1
%e A261904 12 2 2 2
%e A261904 13 3 2 0
%e A261904 14 3 2 1
%e A261904 15 -1 -1 -1
%e A261904 16 4 0 0
%e A261904 17 4 1 0
%e A261904 18 4 1 1
%e A261904 19 3 3 1
%e A261904 20 4 2 0
%e A261904 ...
%Y A261904 Cf. A000378, A004215, A005875, A261915.
%Y A261904 Analogs for 4 squares: A178786 and A122921.
%K A261904 sign
%O A261904 0,5
%A A261904 _N. J. A. Sloane_, Sep 08 2015
%E A261904 More terms from _David Consiglio, Jr._, Sep 08 2015