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.

A073609 a(0) = 2; a(n) for n > 0 is the smallest prime greater than a(n-1) that differs from a(n-1) by a square.

Original entry on oeis.org

2, 3, 7, 11, 47, 83, 227, 263, 587, 911, 947, 983, 1019, 1163, 1307, 1451, 1487, 1523, 1559, 2459, 3359, 4259, 4583, 5483, 5519, 5843, 5879, 6203, 6779, 7103, 7247, 7283, 7607, 7643, 8219, 8363, 10667, 11243, 11279, 11423, 12323, 12647, 12791, 13367
Offset: 0

Views

Author

Amarnath Murthy, Aug 05 2002

Keywords

Comments

For n > 2, a(n) must be of the form 36k + 11. This is seen by induction since 36k + 11 + m^2 is even if m is odd and since 36k + 11 + (6m + 2)^2 and 36k + 11 + (6m + 4)^2 are both divisible by 3. - Gerald McGarvey, Jun 03 2007

Examples

			After 3, we skip over 5 because 5 - 3 = 2, which is not a square, but 7 - 3 = 4 = 2^2, so 7 follows 3 in the sequence.
11 is the next prime after 7 and it differs from 7 by 4, so 11 follows 7 in the sequence.
47 differs from 11 by 36 = 6^2 and no prime between 11 and 47 differs from 11 by a square, so 47 is the next term after 11.
		

Crossrefs

Cf. A217840.

Programs

  • Mathematica
    p = 11; s2 = Join[{2, 3, 7, 11}, Table[x = 6; While[!PrimeQ[a = p + x^2], x = x + 6]; p = a, {99}]] (* Murthy *)
    nxt[n_] := Module[{np = NextPrime[n]}, While[!IntegerQ[Sqrt[np - n]], np = NextPrime[np]]; np]; NestList[nxt, 2, 50] (* Harvey P. Dale, Mar 13 2013 *)
  • PARI
    print1(a=2,","); for(n=1,43,k=1; while(!isprime(b=a+k^2),k++); print1(a=b,","))

Extensions

Edited and extended by Klaus Brockhaus, Aug 07 2002

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.