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.
%I A273302 #6 May 19 2016 11:26:21 %S A273302 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, %T A273302 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, %U A273302 1,1,2,3,0,0,0,1,0,0,0,3,4 %N 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. %C A273302 Clearly, a(n) = 0 if n is a square. Part (i) of the conjecture in A271518 implies that a(n) always exists. %C A273302 Compare this sequence with A273294. %C A273302 For more conjectural refinements of Lagrange's four-square theorem, one may consult arXiv:1604.06723. %H A273302 Zhi-Wei Sun, <a href="/A273302/b273302.txt">Table of n, a(n) for n = 0..10000</a> %H A273302 Zhi-Wei Sun, <a href="http://arxiv.org/abs/1604.06723">Refining Lagrange's four-square theorem</a>, arXiv:1604.06723 [math.GM], 2016. %e A273302 a(6) = 1 since 6 = 1^2 + 1^2 + 0^2 + 2^2 with 1 + 3*1 + 5*0 = 2^2. %e A273302 a(7) = 1 since 7 = 1^2 + 1^2 + 1^2 + 2^2 with 1 + 3*1 + 5*1 = 3^2. %e A273302 a(15) = 2 since 15 = 2^2 + 3^2 + 1^2 + 1^2 with 2 + 3*3 + 5*1 = 4^2. %e A273302 a(31) = 5 since 31 = 5^2 + 2^2 + 1^2 + 1^2 with 5 + 3*2 + 5*1 = 4^2. %e A273302 a(32) = 4 since 32 = 4^2 + 0^2 + 0^2 + 4^2 with 4 + 3*0 + 5*0 = 2^2. %e A273302 a(2384) = 24 since 2384 = 24^2 + 12^2 + 8^2 + 40^2 with 24 + 3*12 + 5*8 = 10^2. %t A273302 SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]] %t A273302 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}] %Y A273302 Cf. A000118, A000290, A260625, A261876, A262357, A267121, A268197, A268507, A269400, A270073, A271510, A271513, A271518, A271608, A271665, A271714, A271721, A271724, A271775, A271778, A271824, A272084, A272332, A272351, A272620, A272888, A272977, A273021, A273107, A273108, A273110, A273134, A273278, A273294. %K A273302 nonn %O A273302 0,16 %A A273302 _Zhi-Wei Sun_, May 19 2016