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.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

0, 2, 3, 3, 3, 5, 5, 5, 5, 5, 7, 7, 7, 9, 9, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, 13, 15, 15, 15, 17, 17, 17, 17, 17, 19, 19, 19, 21, 21, 21, 21, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25, 25, 25, 27, 27, 27, 27, 27, 29, 29, 29, 31, 31, 31, 31, 35, 35, 35, 35, 35, 35
Offset: 0

Views

Author

Seiichi Manyama, Nov 28 2017

Keywords

Examples

			Solutions to (x,y) = 1 and x^2 + y^2 <= 17;
  *         (1,4)
  * *       (1,3), (2,3)
  *   *     (1,2), (3,2)
* * * * *   (0,1), (1,1), (2,1), (3,1), (4,1)
  *         (1,0)
            a(17) = 11.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Boole[GCD[i, j]==1 ], {i, 0, Sqrt[n]}, {j, 0, Sqrt[n-i^2]}];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jul 05 2018, after Andrew Howroyd *)
  • PARI
    a(n) = {sum(i=0, sqrtint(n), sum(j=0, sqrtint(n-i^2), gcd(i, j) == 1))} \\ Andrew Howroyd, Dec 12 2017

Formula

a(n) = a(n-1) + A295819(n) for n > 0.

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 *)
Showing 1-2 of 2 results.