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-3 of 3 results.

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

Original entry on oeis.org

0, 2, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 0, 0
Offset: 0

Views

Author

Seiichi Manyama, Nov 28 2017

Keywords

Examples

			a(1) = 2;
(1,0) = 1 and 1^2 + 0^2 =  1.
(0,1) = 1 and 0^2 + 1^2 =  1.
a(2) = 1;
(1,1) = 1 and 1^2 + 1^2 =  2. ->  1^2 +  1^2 == 1^2 + 1 == 0 mod  2.
a(5) = 2;
(2,1) = 1 and 2^2 + 1^2 =  5. ->  2^2 +  1^2 == 2^2 + 1 == 0 mod  5.
(1,2) = 1 and 1^2 + 2^2 =  5. ->  3^2 +  6^2 == 3^2 + 1 == 0 mod  5.
a(10) = 2;
(3,1) = 1 and 3^2 + 1^2 = 10. ->  3^2 +  1^2 == 3^2 + 1 == 0 mod 10.
(1,3) = 1 and 1^2 + 3^2 = 10. ->  7^2 + 21^2 == 7^2 + 1 == 0 mod 10.
a(13) = 2;
(3,2) = 1 and 3^2 + 2^2 = 13. -> 21^2 + 14^2 == 8^2 + 1 == 0 mod 13.
(2,3) = 1 and 2^2 + 3^2 = 13. -> 18^2 + 27^2 == 5^2 + 1 == 0 mod 13.
		

Crossrefs

Cf. A006278.
Similar sequences: A000010, A000925, A295820, A295848, A295976.
A000089 is essentially the same sequence.

Programs

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

Formula

a(n) = A000089(n) for n >= 2.
a(A006278(n)) = 2^n for n >= 1.

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

Original entry on oeis.org

0, 3, 6, 7, 7, 13, 16, 16, 16, 19, 25, 28, 28, 34, 40, 40, 40, 49, 52, 55, 55, 61, 64, 64, 64, 70, 82, 85, 85, 97, 103, 103, 103, 109, 118, 124, 124, 130, 139, 139, 139, 154, 160, 163, 163, 169, 175, 175, 175, 181, 193, 199, 199, 211, 220, 220, 220, 226, 232, 241
Offset: 0

Views

Author

Seiichi Manyama, Nov 29 2017

Keywords

Crossrefs

Programs

  • Maple
    N:= 100:
    V:= Vector(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:
    0,op(ListTools:-PartialSums(convert(V,list))); # Robert Israel, Nov 30 2017
  • Mathematica
    a[n_] := Sum[Boole[GCD[i, j, k] == 1], {i, 0, Sqrt[n]}, {j, 0, Sqrt[n - i^2]}, {k, 0, Sqrt[n - i^2 - j^2]}];
    Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Jul 07 2018, after Andrew Howroyd *)
  • PARI
    a(n) = {sum(i=0, sqrtint(n), sum(j=0, sqrtint(n-i^2), sum(k=0, sqrtint(n-i^2-j^2), gcd([i, j, k]) == 1)))} \\ Andrew Howroyd, Dec 12 2017

Formula

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

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

Original entry on oeis.org

0, 2, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
Offset: 0

Views

Author

Seiichi Manyama, Dec 01 2017

Keywords

Crossrefs

Programs

  • PARI
    {a(n) = sum(i=0, n, sum(j=0, n, if((gcd(i, j)==1) && (i^3+j^3<=n), 1, 0)))}

Formula

a(n) = a(n-1) + A295976(n) for n > 0.
Showing 1-3 of 3 results.