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.

A273302 Least nonnegative integer x such that n = x^2 + y^2 + z^2 + w^2 for some nonnegative integer y,z,w with x + 3*y + 5*z a square.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 0, 1, 1, 2, 2, 1, 0, 0, 0, 1, 1, 0, 0, 5, 4, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 4, 0, 0, 1, 1, 4, 0, 1, 0, 0, 0, 0, 5, 0, 0, 2, 0, 0, 1, 0, 1, 1, 2, 3, 0, 0, 0, 1, 0, 0, 0, 3, 4
Offset: 0

Views

Author

Zhi-Wei Sun, May 19 2016

Keywords

Comments

Clearly, a(n) = 0 if n is a square. Part (i) of the conjecture in A271518 implies that a(n) always exists.
Compare this sequence with A273294.
For more conjectural refinements of Lagrange's four-square theorem, one may consult arXiv:1604.06723.

Examples

			a(6) = 1 since 6 = 1^2 + 1^2 + 0^2 + 2^2 with 1 + 3*1 + 5*0 = 2^2.
a(7) = 1 since 7 = 1^2 + 1^2 + 1^2 + 2^2 with 1 + 3*1 + 5*1 = 3^2.
a(15) = 2 since 15 = 2^2 + 3^2 + 1^2 + 1^2 with 2 + 3*3 + 5*1 = 4^2.
a(31) = 5 since 31 = 5^2 + 2^2 + 1^2 + 1^2 with 5 + 3*2 + 5*1 = 4^2.
a(32) = 4 since 32 = 4^2 + 0^2 + 0^2 + 4^2 with 4 + 3*0 + 5*0 = 2^2.
a(2384) = 24 since 2384 = 24^2 + 12^2 + 8^2 + 40^2 with 24 + 3*12 + 5*8 = 10^2.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]
    Do[Do[If[SQ[n-x^2-y^2-z^2]&&SQ[x+3y+5z],Print[n," ",x];Goto[aa]],{x,0,Sqrt[n]},{y,0,Sqrt[n-x^2]},{z,0,Sqrt[n-x^2-y^2]}];Label[aa];Continue,{n,0,80}]