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

A217840 Total number of solutions to the equation x^2 + k*y^2 = n with x >= 0, y >= 0, k > 0, or 0 if the number is infinite. Order matters for the equation x^2 + y^2 = n.

Original entry on oeis.org

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

Views

Author

V. Raman, Oct 16 2012

Keywords

Comments

If the equation x^2 + y^2 = n has two solutions (x, y), (y, x) then they will be counted differently.
No solutions can exist for the values of k > n.
a(n) is the same as A216673(n) when n is not the sum of two positive squares.
But when n is the sum of two positive squares, the ordered pairs for the equation x^2 + y^2 = n count.
For example,
10 = 3^2 + 1^2.
10 = 1^2 + 3^2.
10 = 2^2 + 6*1^2.
10 = 1^2 + 9*1^2.
10 = 0^2 + 10*1^2.
So a(10) = 5. On the other hand, for the sequence A216673, the ordered pair 3^2 + 1^2 and 1^2 + 3^2 will be counted as the same, and so A216673(10) = 4.

Crossrefs

Cf. A216673 (a variant of this sequence, when the order does not matter for the equation x^2 + y^2 = n, i.e., if the equation x^2 + y^2 = n has two solutions (x, y), (y, x) then they will be counted as the same).
Cf. A046951.

Programs

  • PARI
    for(n=1, 100, sol=0; for(k=1, n, for(x=0, n, if((issquare(n-k*x*x)&&n-k*x*x>=0), sol++))); if(issquare(n),print1(0", "),print1(sol", "))) /* V. Raman, Oct 16 2012 */

Formula

a(n) = 0 if n is a square, otherwise a(n) = Sum_{k = 0..sqrt(n)} A046951(n-k^2). - Charlie Neder, Jan 15 2019

A216672 Total number of solutions to the equation x^2 + k*y^2 = n with x > 0, y > 0, k > 0. (Order does not matter for the equation x^2 + y^2 = n.)

Original entry on oeis.org

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

Views

Author

V. Raman, Sep 13 2012

Keywords

Comments

If the equation x^2 + y^2 = n has two solutions (x, y), (y, x) then they will be counted only once.
No solutions can exist for the values of k >= n.
This sequence differs from A216503 since this sequence gives the total number of solutions to the equation x^2 + k*y^2 = n, whereas the sequence A216503 gives the number of distinct values of k for which a solution to the equation x^2 + k*y^2 = n can exist.
Some values of k can clearly have more than one solution.
For example, x^2 + k*y^2 = 33 is satisfiable for
33 = 1^2 + 2*4^2.
33 = 5^2 + 2*2^2.
33 = 3^2 + 6*2^2.
33 = 1^2 + 8*2^2.
33 = 5^2 + 8*1^2.
33 = 4^2 + 17*1^2.
33 = 3^2 + 24*1^2.
33 = 2^2 + 29*1^2.
33 = 1^2 + 32*1^2.
So for this sequence a(33) = 9.
On the other hand, for the sequence A216503, there exist only 7 different values of k for which a solution to the equation mentioned above exists.
So A216503(33) = 7.

Crossrefs

Cf. A217834 (a variant of this sequence, when the order does matter for the equation x^2+y^2 = n, i.e. if the equation x^2+y^2 = n has got two solutions (x, y), (y, x) then they will be counted separately).

Programs

  • Mathematica
    nn = 100; t = Table[0, {nn}]; Do[n = x^2 + k*y^2; If[n <= nn && (k > 1 || k == 1 && x <= y), t[[n]]++], {x, Sqrt[nn]}, {y, Sqrt[nn]}, {k, nn}] (* T. D. Noe, Sep 20 2012 *)
  • PARI
    for(n=1, 100, sol=0; for(k=1, n, for(x=1, n, if((issquare(n-k*x*x)&&n-k*x*x>0&&k>=2)||(issquare(n-x*x)&&n-x*x>0&&k==1&&x*x<=n-x*x), sol++))); print1(sol", ")) /* V. Raman, Oct 16 2012 */

Extensions

Ambiguity in name corrected by V. Raman, Oct 16 2012

A216674 Total number of solutions to the equation x^2+k*y^2 = n with x > 0, y > 0, k >= 0, or 0 if infinite. (Order does not matter for the equation x^2+y^2 = n).

Original entry on oeis.org

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

Views

Author

V. Raman, Sep 13 2012

Keywords

Comments

If the equation x^2+y^2 = n has got two solutions (x, y), (y, x) then they will be counted only once.
No solutions can exist for the values of k >= n.
This sequence differs from A216505 in the fact that this sequence gives the total number of solutions to the equation x^2+k*y^2 = n, whereas the sequence A216505 gives the number of distinct values of k for which a solution to the equation x^2+k*y^2 = n can exist.
Some values of k can clearly have more than one solution.
For example, x^2+k*y^2 = 33 is satisfiable for
33 = 1^2+2*4^2.
33 = 5^2+2*2^2.
33 = 3^2+6*2^2.
33 = 1^2+8*2^2.
33 = 5^2+8*1^2.
33 = 4^2+17*1^2.
33 = 3^2+24*1^2.
33 = 2^2+29*1^2.
33 = 1^2+32*1^2.
So for this sequence a(33) = 9.
On the other hand, for the sequence A216505, there exist only 7 different values of k for which a solution to the equation mentioned above exists.
So A216505(33) = 7.

Crossrefs

Cf. A217956 (a variant of this sequence, when the order does matter for the equation x^2+y^2 = n, i.e. if the equation x^2+y^2 = n has got two solutions (x, y), (y, x) then they will be counted separately).

Programs

  • PARI
    a(n)=if(issquare(n),return(0));sum(y=ceil(sqrt(n/2-1/4)), sqrtint(n-1),issquare(n-y^2))+sum(k=2,n-1,sum(y=1,sqrtint((n-1)\k), issquare(n-k*y^2))) \\ Charles R Greathouse IV, Sep 14 2012
    
  • PARI
    for(n=1, 100, sol=0; for(k=0, n, for(x=1, n, if((issquare(n-k*x*x)&&n-k*x*x>0&&k>=2)||(issquare(n-x*x)&&n-x*x>0&&k==1&&x*x<=n-x*x), sol++))); if(issquare(n),print1(0", "),print1(sol", "))) /* V. Raman, Oct 16 2012 */

Extensions

Ambiguity in name corrected by V. Raman, Oct 16 2012

A216673 Total number of solutions to the equation x^2 + k*y^2 = n with x >= 0, y >= 0, k > 0, or 0 if the number is infinite. (Order does not matter for the equation x^2 + y^2 = n).

Original entry on oeis.org

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

Views

Author

V. Raman, Sep 13 2012

Keywords

Comments

If the equation x^2+y^2 = n has got two solutions (x, y), (y, x) then they will be counted only once.
No solutions can exist for the values of k > n.
This sequence differs from A216504, since this sequence gives the total number of solutions to the equation x^2+k*y^2 = n, whereas the sequence A216504 gives the number of distinct values of k for which a solution to the equation x^2+k*y^2 = n can exist.
Some values of k can clearly have more than one solution.
For example, x^2+k*y^2 = 33 is satisfiable for
33 = 1^2+2*4^2.
33 = 5^2+2*2^2.
33 = 3^2+6*2^2.
33 = 1^2+8*2^2.
33 = 5^2+8*1^2.
33 = 4^2+17*1^2.
33 = 3^2+24*1^2.
33 = 2^2+29*1^2.
33 = 1^2+32*1^2.
33 = 0^2+33*1^2.
So for this sequence a(33) = 10.
On the other hand, for A216504, there exist only 7 different values of k for which a solution to the equation mentioned above exists.
So A216504(33) = 8.

Crossrefs

Cf. A217840 (a variant of this sequence, when the order does matter for the equation x^2+y^2 = n, i.e. if the equation x^2+y^2 = n has got two solutions (x, y), (y, x) then they will be counted separately).

Programs

  • PARI
    for(n=1, 100, sol=0; for(k=1, n, for(x=0, n, if((issquare(n-k*x*x)&&n-k*x*x>=0&&k>=2)||(issquare(n-x*x)&&n-x*x>=0&&k==1&&x*x<=n-x*x), sol++))); if(issquare(n),print1(0", "),print1(sol", "))) /* V. Raman, Oct 16 2012 */

Extensions

Ambiguity in name corrected by V. Raman, Oct 16 2012

A217834 Total number of solutions to the equation x^2+k*y^2 = n with x > 0, y > 0, k > 0. (Order matters for the equation x^2+y^2 = n).

Original entry on oeis.org

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

Views

Author

V. Raman, Oct 16 2012

Keywords

Comments

If the equation x^2+y^2 = n has got two solutions (x, y), (y, x) then they will be counted differently.
No solutions can exist for the values of k >= n.
a(n) is the same as A216672(n) when n is not the sum of two positive squares.
But when n is the sum of two positive squares, the ordered pairs for the equation x^2+y^2 = n count.
For example,
10 = 3^2 + 1^2.
10 = 1^2 + 3^2.
10 = 2^2 + 6*1^2.
10 = 1^2 + 9*1^2.
So a(10) = 4. On the other hand, for the sequence A216672, the ordered pair 3^2+1^2 and 1^2+3^2 will be counted as the same, and so A216672(10) = 3.

Crossrefs

Cf. A216672 (a variant of this sequence, when the order does not matter for the equation x^2+y^2 = n, i.e. if the equation x^2+y^2 = n has got two solutions (x, y), (y, x) then they will be counted as the same).

Programs

  • PARI
    for(n=1, 100, sol=0; for(k=1, n, for(x=1, n, if((issquare(n-k*x*x)&&n-k*x*x>0), sol++))); print1(sol", ")) /* V. Raman, Oct 16 2012 */

A217956 Total number of solutions to the equation x^2+k*y^2 = n with x > 0, y > 0, k >= 0, or 0 if infinite. (Order matters for the equation x^2+y^2 = n).

Original entry on oeis.org

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

Views

Author

V. Raman, Oct 16 2012

Keywords

Comments

If the equation x^2+y^2 = n has two solutions (x, y), (y, x) then they will be counted differently.
No solutions can exist for the values of k >= n.
a(n) is the same as A216674(n) when n is not the sum of two positive squares.
But when n is the sum of two positive squares, the ordered pairs for the equation x^2+y^2 = n count.
For example,
10 = 3^2 + 1^2.
10 = 1^2 + 3^2.
10 = 2^2 + 6*1^2.
10 = 1^2 + 9*1^2.
So a(10) = 4. On the other hand, for the sequence A216674, the ordered pair 3^2+1^2 and 1^2+3^2 will be counted as the same, and so A216674(10) = 3.

Crossrefs

Cf. A216674 (a variant of this sequence, when the order does not matter for the equation x^2+y^2 = n, i.e. if the equation x^2+y^2 = n has got two solutions (x, y), (y, x) then they will be counted as the same).

Programs

  • PARI
    for(n=1, 100, sol=0; for(k=0, n, for(x=1, n, if((issquare(n-k*x*x)&&n-k*x*x>0), sol++))); if(issquare(n),print1(0", "),print1(sol", "))) /* V. Raman, Oct 16 2012 */
Showing 1-6 of 6 results.