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.

A272888 Number of ordered ways to write n as w^2 + x^2 + y^2 + z^2 with w*(x^2 + 8*y^2 - z^2) a square, where w,x,y are nonnegative integers and z is a positive integer.

Original entry on oeis.org

1, 2, 2, 1, 4, 5, 1, 2, 5, 5, 4, 4, 5, 8, 2, 2, 8, 6, 4, 6, 9, 5, 3, 4, 5, 12, 9, 1, 11, 8, 4, 2, 8, 9, 8, 7, 6, 12, 1, 5, 14, 10, 4, 8, 15, 9, 3, 4, 8, 14, 11, 5, 11, 16, 2, 6, 11, 6, 11, 4, 13, 13, 1, 1, 16, 17, 6, 9, 13, 9, 5, 7, 9, 19, 12, 6, 17, 8, 4, 6
Offset: 1

Views

Author

Zhi-Wei Sun, May 08 2016

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0, and a(n) = 1 only for n = 1, 7, 39, 63, 87, 5116, 2^(4k+2)*m (k = 0,1,2,... and m = 1, 7).
See arXiv:1604.06723 for more refinements of Lagrange's four-square theorem.

Examples

			a(1) = 1 since 1 = 0^2 + 0^2 + 0^2 + 1^2 with 1 > 0 and 0*(0^2 + 8*0^2 - 1^2) = 0^2.
a(4) = 1 since 4 = 0^2 + 0^2 + 0^2 + 2^2 with 2 > 0 and 0*(0^2 + 8*0^2 - 2^2) = 0^2.
a(7) = 1 since 7 = 2^2 + 1^2 + 1^2 + 1^2 with 1 > 0 and 2*(1^2 + 8*1^2 - 1^2) = 4^2.
a(28) = 1 since 28 = 2^2 + 2^2 + 4^2 + 2^2 with 2 > 0 and 2*(2^2 + 8*4^2 - 2^2) = 16^2.
a(39) = 1 since 39 = 1^2 + 3^2 + 2^2 + 5^2 with 5 > 0 and 1*(3^2 + 8*2^2 - 5^2) = 4^2.
a(63) = 1 since 63 = 2^2 + 5^2 + 3^2 + 5^2 with 5 > 0 and 2*(5^2 + 8*3^2 - 5^2) = 12^2.
a(87) = 1 since 87 = 2^2 + 1^2 + 9^2 + 1^2 with 1 > 0 and 2*(1^2 + 8*9^2 - 1^2) = 36^2.
a(5116) = 1 since 5116 = 65^2 + 9^2 + 9^2 + 27^2 with 27 > 0 and 65*(9^2 + 8*9^2 - 27^2) = 0^2.
		

Crossrefs

Programs

  • Maple
    N:= 1000; # to get a(1)..a(N)
    A:= Vector(N):
    for z from 1 to floor(sqrt(N)) do
      for x from 0 to floor(sqrt(N-z^2)) do
        for y from 0 to floor(sqrt(N-z^2-x^2)) do
          q:= x^2 + 8*y^2 - z^2;
          if q < 0 then
            A[x^2+y^2+z^2]:= A[x^2+y^2+z^2]+1
          elif q = 0 then
            for w from 0 to floor(sqrt(N-z^2-x^2-y^2)) do
               m:= w^2 + x^2 + y^2 + z^2;
               A[m]:= A[m]+1;
            od
          else
            wm:= mul(`if`(t[2]::odd, t[1], 1), t=isqrfree(q)[2]);
            for j from 0 to floor((N-z^2-x^2-y^2)^(1/4)/sqrt(wm)) do
               m:= (wm*j^2)^2 + x^2 + y^2 + z^2;
               A[m]:= A[m]+1;
            od;
          fi
        od
      od
    od:
    convert(A,list); # Robert Israel, May 27 2016
  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]
    Do[r=0;Do[If[SQ[n-x^2-y^2-z^2]&&SQ[Sqrt[n-x^2-y^2-z^2](x^2+8y^2-z^2)],r=r+1],{x,0,Sqrt[n-1]},{y,0,Sqrt[n-1-x^2]},{z,1,Sqrt[n-x^2-y^2]}];Print[n," ",r];Continue,{n,1,80}]

Extensions

Rick L. Shepherd, May 27 2016: I checked all the statements in each example.