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.

A295848 Number of nonnegative solutions to (x,y,z) = 1 and x^2 + y^2 + z^2 = n.

Original entry on oeis.org

0, 3, 3, 1, 0, 6, 3, 0, 0, 3, 6, 3, 0, 6, 6, 0, 0, 9, 3, 3, 0, 6, 3, 0, 0, 6, 12, 3, 0, 12, 6, 0, 0, 6, 9, 6, 0, 6, 9, 0, 0, 15, 6, 3, 0, 6, 6, 0, 0, 6, 12, 6, 0, 12, 9, 0, 0, 6, 6, 9, 0, 12, 12, 0, 0, 18, 12, 3, 0, 12, 6, 0, 0, 9, 18, 6, 0, 12, 6, 0, 0, 9, 9, 9
Offset: 0

Views

Author

Seiichi Manyama, Nov 29 2017

Keywords

Comments

a(n)=0 for n in A047536. - Robert Israel, Nov 30 2017

Examples

			a(1) = 3;
(1,0,0) = 1 and 1^2 + 0^2 + 0^2 = 1.
(0,1,0) = 1 and 0^2 + 1^2 + 0^2 = 1.
(0,0,1) = 1 and 0^2 + 0^2 + 1^2 = 1.
a(2) = 3;
(1,1,0) = 1 and 1^2 + 1^2 + 0^2 = 2.
(1,0,1) = 1 and 1^2 + 0^2 + 1^2 = 2.
(0,1,1) = 1 and 0^2 + 1^2 + 1^2 = 2.
a(3) = 1;
(1,1,1) = 1 and 1^2 + 1^2 + 1^2 = 3.
a(5) = 6;
(2,1,0) = 1 and 2^2 + 1^2 + 0^2 = 5.
(2,0,1) = 1 and 2^2 + 0^2 + 1^2 = 5.
(1,2,0) = 1 and 1^2 + 2^2 + 0^2 = 5.
(1,0,2) = 1 and 1^2 + 0^2 + 2^2 = 5.
(0,2,1) = 1 and 0^2 + 2^2 + 1^2 = 5.
(0,1,2) = 1 and 0^2 + 1^2 + 2^2 = 5.
		

Crossrefs

Programs

  • Maple
    N:= 100:
    V:= Array(0..N):
    for x from 0 to floor(sqrt(N/3)) do
      for y from x to floor(sqrt((N-x^2)/2)) do
        for z from y to floor(sqrt(N-x^2-y^2)) do
          if igcd(x,y,z) = 1 then
            r:= x^2 + y^2 + z^2;
            m:= nops({x,y,z});
            if m=3 then V[r]:= V[r]+6
            elif m=2 then V[r]:= V[r]+3
            else V[r]:= V[r]+1
            fi
          fi
    od od od:
    convert(V,list); # Robert Israel, Nov 30 2017
  • Mathematica
    f[n_] := Total[ Length@ Permutations@# & /@ Select[ PowersRepresentations[n, 3, 2], GCD[#[[1]], #[[2]], #[[3]]] == 1 &]]; Array[f, 90, 0] (* Robert G. Wilson v, Nov 30 2017 *)