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.

A261915 Smallest 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.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, -1, 2, 2, 3, 3, 2, 3, 3, -1, 4, 3, 3, 3, 4, 4, 3, -1, 4, 4, 4, 3, -1, 4, 5, -1, 4, 4, 4, 5, 4, 6, 5, -1, 6, 4, 5, 5, 6, 5, 6, -1, 4, 6, 5, 5, 6, 6, 5, -1, 6, 5, 7, 5, -1, 6, 6, -1, 8, 6, 5, 7, 6, 7, 6, -1, 6, 6, 7, 5, 6, 6, 7, -1, 8, 6, 8
Offset: 0

Views

Author

N. J. A. Sloane, Sep 11 2015

Keywords

Comments

a(n) = -1 iff n is in A004215, a(n) >= 0 iff n is in A000378.
If we maximize x we get A261904.

Examples

			Table 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  2  2  1
  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  3  2  2
  18  3  3  0
  19  3  3  1
  20  4  2  0
  ...
		

Crossrefs

Analogs for 4 squares: A178786 and A122921.

Extensions

a(17) corrected, more terms from David Consiglio, Jr., Sep 11 2015