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.

A273294 Least nonnegative integer m such that there are nonnegative integers x,y,z,w for which x^2 + y^2 + z^2 + w^2 = n and x + 3*y + 5*z = m^2.

Original entry on oeis.org

0, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 3, 3, 3, 4, 0, 1, 2, 3, 2, 3, 3, 4, 4, 0, 1, 2, 3, 3, 4, 4, 2, 3, 3, 4, 0, 1, 2, 3, 4, 2, 3, 6, 4, 3, 3, 6, 4, 0, 1, 2, 2, 3, 5, 4, 4, 4, 3, 4, 5, 5, 3, 4, 0, 1, 2, 3, 4, 5, 4, 6, 4, 3, 4, 4, 4, 3, 4, 4, 2
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.
For more conjectural refinements of Lagrange's four-square theorem, one may consult arXiv:1604.06723.

Examples

			a(1) = 0 since 1 = 0^2 + 0^2 + 0^2 + 1^2 with 0 + 3*0 + 5*0 = 0^2.
a(2) = 1 since 2 = 1^2 + 0^2 + 0^2 + 1^2 with 1 + 3*0 + 5*0 = 1^2.
a(3) = 2 since 3 = 1^2 + 1^2 + 0^2 + 1^2 with 1 + 3*1 + 5*0 = 2^2.
a(3812) = 11 since 3812 = 37^2 + 3^2 + 15^2 + 47^2 with 37 + 3*3 + 5*15 = 11^2.
a(3840) = 16 since 3840 = 48^2 + 16^2 + 32^2 + 16^2 with 48 + 3*16 + 5*32 = 16^2.
		

Crossrefs

Programs

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