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-10 of 17 results. Next

A002350 Take solution to Pellian equation x^2 - n*y^2 = 1 with smallest positive y and x >= 0; sequence gives a(n) = x, or 1 if n is a square. A002349 gives values of y.

Original entry on oeis.org

1, 3, 2, 1, 9, 5, 8, 3, 1, 19, 10, 7, 649, 15, 4, 1, 33, 17, 170, 9, 55, 197, 24, 5, 1, 51, 26, 127, 9801, 11, 1520, 17, 23, 35, 6, 1, 73, 37, 25, 19, 2049, 13, 3482, 199, 161, 24335, 48, 7, 1, 99, 50, 649, 66249, 485, 89, 15, 151, 19603, 530, 31, 1766319049, 63, 8, 1
Offset: 1

Views

Author

Keywords

Comments

From A.H.M. Smeets, Nov 20 2017: (Start)
a(p*q^2) = b(p,q/gcd(A002349(p),q)) where
b(p,0) = 1, b(p,1) = a(p), b(p,i) = 2*a(p)*b(p,i-1) - b(p,i-2) for i>1. (End)

Examples

			For n = 1, 2, 3, 4, 5 solutions are (x,y) = (1, 0), (3, 2), (2, 1), (1, 0), (9, 4).
		

References

  • A. Cayley, Report of a committee appointed for the purpose of carrying on the tables connected with the Pellian equation ..., Collected Mathematical Papers. Vols. 1-13, Cambridge Univ. Press, London, 1889-1897, Vol. 13, pp. 430-443.
  • C. F. Degen, Canon Pellianus. Hafniae, Copenhagen, 1817.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    PellSolve[(m_Integer)?Positive] := Module[{cf, n, s}, cf = ContinuedFraction[ Sqrt[m]]; n = Length[ Last[cf]]; If[ OddQ[n], n = 2*n]; s = FromContinuedFraction[ ContinuedFraction[ Sqrt[m], n]]; {Numerator[s], Denominator[s]}]; f[n_] := If[ !IntegerQ[ Sqrt[n]], PellSolve[n][[1]], 1]; Table[ f[n], {n, 0, 65}]
    Table[If[! IntegerQ[Sqrt[k]], {k, FindInstance[x^2 - k*y^2 == 1 && x > 0 && y > 0, {x, y}, Integers]}, Nothing], {k, 2, 80}][[All, 2, 1, 1, 2]] (* Horst H. Manninger, Mar 23 2021 *)
  • Python
    from sympy.ntheory.primetest import is_square
    from sympy.solvers.diophantine.diophantine import diop_DN
    def A002350(n): return 1 if is_square(n) else next(a for a,b in diop_DN(n,1)) # Chai Wah Wu, Feb 11 2025

Formula

a(prime(i)) = A081233(i). - R. J. Mathar, Feb 25 2025

A002349 Take solution to Pellian equation x^2 - n*y^2 = 1 with smallest positive y and x >= 0; sequence gives a(n) = y, or 0 if n is a square. A002350 gives values of x.

Original entry on oeis.org

0, 2, 1, 0, 4, 2, 3, 1, 0, 6, 3, 2, 180, 4, 1, 0, 8, 4, 39, 2, 12, 42, 5, 1, 0, 10, 5, 24, 1820, 2, 273, 3, 4, 6, 1, 0, 12, 6, 4, 3, 320, 2, 531, 30, 24, 3588, 7, 1, 0, 14, 7, 90, 9100, 66, 12, 2, 20, 2574, 69, 4, 226153980, 8, 1, 0, 16, 8, 5967, 4, 936, 30, 413, 2, 267000, 430, 3
Offset: 1

Views

Author

Keywords

Examples

			For n = 1, 2, 3, 4, 5 solutions are (x,y) = (1, 0), (3, 2), (2, 1), (1, 0), (9, 4).
		

References

  • Albert H. Beiler, "The Pellian" (chap 22), Recreations in the Theory of Numbers, 2nd ed. NY: Dover, 1966.
  • A. Cayley, Report of a committee appointed for the purpose of carrying on the tables connected with the Pellian equation ..., Collected Mathematical Papers. Vols. 1-13, Cambridge Univ. Press, London, 1889-1897, Vol. 13, pp. 430-443.
  • C. F. Degen, Canon Pellianus. Hafniae, Copenhagen, 1817.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • E. E. Whitford, The Pell Equation.

Crossrefs

Programs

  • Mathematica
    a[n_] := If[IntegerQ[Sqrt[n]], 0, For[y=1, !IntegerQ[Sqrt[n*y^2+1]], y++, Null]; y]
    (* Second program: *)
    PellSolve[(m_Integer)?Positive] := Module[{cof, n, s}, cof = ContinuedFraction[ Sqrt[m]]; n = Length[ Last[cof]]; If[ OddQ[n], n = 2*n]; s = FromContinuedFraction[ ContinuedFraction[ Sqrt[m], n]]; {Numerator[s], Denominator[s]}]; f[n_] := If[ !IntegerQ[ Sqrt[n]], PellSolve[n][[2]], 0]; Table[ f[n], {n, 0, 75}]
  • Python
    from sympy.ntheory.primetest import is_square
    from sympy.solvers.diophantine.diophantine import diop_DN
    def A002349(n): return 0 if is_square(n) else next(b for a,b in diop_DN(n,1)) # Chai Wah Wu, Feb 11 2025

Formula

a(prime(i)) = A081234(i). - R. J. Mathar, Feb 25 2025

Extensions

More terms from Enoch Haga, Mar 14 2002
Better description from Robert G. Wilson v, Apr 14 2003

A033315 Incrementally largest values of minimal x satisfying Pell equation x^2 - D*y^2 = 1.

Original entry on oeis.org

1, 3, 9, 19, 649, 9801, 24335, 66249, 1766319049, 158070671986249, 2469645423824185801, 159150073798980475849, 838721786045180184649, 25052977273092427986049, 3879474045914926879468217167061449
Offset: 1

Views

Author

Keywords

Crossrefs

Records in A033313 (or A002350).
Cf. A033316 (corresponding values of D).

Programs

  • Mathematica
    PellSolve[(m_Integer)?Positive] := Module[{cf, n, s}, cf = ContinuedFraction[Sqrt[m]]; n = Length[Last[cf]]; If[n == 0, Return[{}]]; If[OddQ[n], n = 2 n]; s = FromContinuedFraction[ ContinuedFraction[ Sqrt[m], n]]; {Numerator[s], Denominator[s]}];
    xx = DeleteCases[PellSolve /@ Range[10^5], {}][[All, 1]];
    Reap[Module[{x, record = 0}, Sow[1]; For[i = 1, i <= Length@xx, i++, x = xx[[i]]; If[x > record, record = x; Sow[x]]]]][[2, 1]] (* Jean-François Alcover, Nov 21 2020, after N. J. A. Sloane in A002349 *)

A033319 Incrementally largest values of minimal y satisfying Pell equation x^2-Dy^2=1.

Original entry on oeis.org

0, 2, 4, 6, 180, 1820, 3588, 9100, 226153980, 15140424455100, 183567298683461940, 9562401173878027020, 42094239791738433660, 1238789998647218582160, 189073995951839020880499780706260
Offset: 1

Views

Author

Keywords

Comments

Records in A033317 (or A002349).

Crossrefs

Programs

  • Mathematica
    PellSolve[(m_Integer)?Positive] := Module[{cf, n, s}, cf = ContinuedFraction[Sqrt[m]]; n = Length[Last[cf]]; If[n == 0, Return[{}]]; If[OddQ[n], n = 2 n]; s = FromContinuedFraction[ ContinuedFraction[ Sqrt[m], n]]; {Numerator[s], Denominator[s]}];
    yy = DeleteCases[PellSolve /@ Range[10^5], {}][[All, 2]];
    Reap[Module[{y, record = 0}, Sow[0]; For[i = 1, i <= Length@yy, i++, y = yy[[i]]; If[y > record, record = y; Sow[y]]]]][[2, 1]] (* Jean-François Alcover, Nov 21 2020, after N. J. A. Sloane in A002350 *)

A336790 Values of odd prime numbers, D, for incrementally largest values of minimal x satisfying the equation x^2 - D*y^2 = -2.

Original entry on oeis.org

3, 11, 19, 43, 67, 139, 211, 331, 379, 571, 739, 859, 1051, 1291, 1531, 1579, 1699, 2011, 2731, 3019, 3259, 3691, 3931, 5419, 5659, 5779, 6211, 6379, 6451, 8779, 9619, 10651, 16699, 17851, 18379, 21739, 25939, 32971, 42331, 42571, 44851, 50131, 53299, 55819, 56611, 60811, 61051, 73459, 76651, 90619, 90931
Offset: 1

Views

Author

Christine Patterson, Oct 14 2020

Keywords

Comments

Analogous to A033316 for x^2-D*y^2=1, and D is required to be prime, and for record values of x.

Examples

			For D=43, the least x for which x^2-D*y^2=-2 has a solution is 59. The next prime, D, for which x^2-D*y^2=-2 has a solution is 59, but the smallest x in this case is 23, which is less than 59. The next prime, D, after 59 for which x^2-D*y^2=-2 has a solution is 67 and the least x for which it has a solution is 221, which is larger than 59, so it is a new record value. 67 is a term of this sequence and 221 is a term of A336791, but 59 is not a term here because the least x for which x^2-47*y^2=-2 has a solution at D=59 is not a record value.
		

Crossrefs

A336792 Values of odd prime numbers, D, for incrementally largest values of minimal positive y satisfying the equation x^2 - D*y^2 = -2.

Original entry on oeis.org

3, 19, 43, 67, 139, 211, 331, 379, 571, 739, 859, 1051, 1291, 1531, 1579, 1699, 2011, 2731, 3019, 3259, 3691, 3931, 5419, 5659, 5779, 6211, 6379, 6451, 8779, 9619, 10651, 16699, 17851, 18379, 21739, 25939, 32971, 42331, 42571, 44851, 50131, 53299, 55819, 56611, 60811, 61051, 73459, 76651, 90619, 90931
Offset: 1

Views

Author

Christine Patterson, Oct 14 2020

Keywords

Comments

For the corresponding y values see A336793.
For solutions of this Diophantine equation it is sufficient to consider the odd primes p(n) := A007520(n), for n >= 1, the primes 3 (mod 8). Also prime 2 has the fundamental solution (x, y) = (0, 1). If there is a solution for p(n) then there is only one infinite family of solutions because there is only one representative parallel primitive binary quadratic form for Discriminant Disc = 4*p(n) and representation k = -2. Only proper solutions can occur. The conjecture is that each p(n) leads to solutions. For the fundamental solutions (with prime 2) see A339881 and A339882. - Wolfdieter Lang, Dec 22 2020

Examples

			For D=3, the least positive y for which x^2-D*y^2=-2 has a solution is 1. The next prime, D, for which x^2-D*y^2=-2 has a solution is 11, but the smallest positive y in this case is also 1, which is equal to the previous record y. So 11 is not a term.
The next prime, D, after 11 for which x^2-D*y^2=-2 has a solution is 19 and the least positive y for which it has a solution is y=3, which is larger than 1, so it is a new record y value. So 19 is a term of this sequence and 3 is a term of A336793.
		

Crossrefs

Cf. A033316 (analogous for x^2-D*y^2=1), A336790 (similar sequence for x's), A336793.

A336794 Value of prime number D for incrementally largest values of minimal x satisfying the equation x^2 - D*y^2 = 3.

Original entry on oeis.org

13, 61, 73, 109, 157, 241, 277, 421, 1549, 3061, 4561, 4861, 5701, 6301, 6829, 8941, 10429, 13381, 14029, 14221, 21169, 22369, 24049, 26161, 29761, 30529, 33601, 39901, 44221, 45061, 47581, 55609, 61609, 62869, 64381, 74869, 97549
Offset: 1

Views

Author

Christine Patterson, Jan 17 2021

Keywords

Comments

Analogous to A033316 for x^2-D*y^2=1, and D is required to be prime, and for record values of x.

Examples

			For D=73, the least x for which x^2-D*y^2=3 has a solution is 94. The next prime, D, for which x^2-D*y^2=3 has a solution is 97, but the smallest x in this case is 10, which is less than 97. The next prime, D, after 97 for which x^2-D*y^2=3 has a solution is 109 and the least x for which it has a solution is 9532, which is larger than 97, so it is a new record value. 73 is a term of this sequence and 94 is a term of A336795, but 97 is not a term here because the least x for which x^2-D*y^2=3 has a solution at D=97 is not a record value.
		

Crossrefs

A336801 Value of prime number D for incrementally largest values of minimal x satisfying the equation x^2 - D*y^2 = -3.

Original entry on oeis.org

3, 7, 13, 31, 43, 61, 181, 397, 541, 661, 1021, 1381, 1621, 3361, 3529, 4201, 4261, 4621, 6421, 9241, 9601, 9949, 12541, 20161, 23209, 25309, 32869, 37321, 43261, 71821, 78901, 82021, 112429, 127261, 131041, 137089
Offset: 1

Views

Author

Christine Patterson, Feb 04 2021

Keywords

Comments

Analogous to A033316 for x^2 - D*y^2 = 1, and D is required to be prime, and for record values of x.

Examples

			For D=13, the least x for which x^2 - D*y^2 = -3 has a solution is 7. The next prime, D, for which x^2 - D*y^2 = -3 has a solution is 19, but the smallest x in this case is 4, which is less than 7. The next prime, D, after 19 for which x^2 - D*y^2 = -3 has a solution is 31 and the least x for which it has a solution is 11, which is larger than 7, so it is a new record value. D=13 is a term of this sequence and x=7 is a term of A341076, but D=19 is not a term here because at D=19 the least x for which x^2 - D*y^2 = -3 has a solution is not a record value.
		

Crossrefs

Extensions

a(1)=3 inserted and Example section edited by Jon E. Schoenfield, Feb 23 2021

A341079 Value of prime number D for incrementally largest values of minimal x satisfying the equation x^2 - D*y^2 = 5.

Original entry on oeis.org

5, 19, 29, 41, 61, 149, 241, 409, 421, 541, 1069, 1249, 1381, 1621, 4261, 4621, 4789, 6301, 8269, 12601, 12721, 14449, 16069, 20101, 32029, 33889, 34381, 35281, 38329, 43261, 45061, 60589, 87481, 89989, 97549, 99661, 121081, 125101, 166021, 178621, 187069, 191689
Offset: 1

Views

Author

Christine Patterson, Feb 04 2021

Keywords

Comments

Analogous to A033316 for x^2 - D*y^2 = 1, and D is required to be prime, and for record values of x.

Examples

			For D=29, the least x for which x^2 - D*y^2 = 5 has a solution is 11. The next prime, D, for which x^2 - D*y^2 = 5 has a solution is 31, but the smallest x in this case is 6, which is less than 11. The next prime, D, after 31 for which x^2 - D*y^2 = 5 has a solution is 41 and the least x for which it has a solution is 13, which is larger than 11, so it is a new record value. 29 is a term of this sequence and 11 is the corresponding term of A341080, but 31 is not a term of this sequence because at D=31 the least x for which x^2 - D*y^2 = 5 has a solution is not a record value.
		

Crossrefs

Extensions

a(1)=5 inserted and Example section edited by Jon E. Schoenfield, Feb 23 2021

A341083 Value of prime number D for incrementally largest values of minimal x satisfying the equation x^2 - D*y^2 = -5.

Original entry on oeis.org

5, 29, 61, 109, 181, 641, 661, 1021, 1549, 2161, 2389, 3169, 3469, 4909, 5581, 8929, 9601, 9949, 12841, 13381, 14029, 17029, 21169, 24709, 25309, 28729, 31249, 32869, 34549, 35149, 39901, 40429, 43801, 48049, 49009, 56401, 56701, 62701, 63541, 70141, 86269, 91009
Offset: 1

Views

Author

Christine Patterson, Feb 13 2021

Keywords

Comments

Analogous to A033316 for x^2 - D*y^2 = 1, and D is required to be prime, and for record values of x.

Examples

			For D=29, the least x for which x^2 - D*y^2 = -5 has a solution is 16. The next prime, D, for which x^2 - D*y^2 = -5 has a solution is 41, but the smallest x in this case is 6, which is less than 16. The next prime, D, after 41 for which x^2 - D*y^2 = -5 has a solution is 61 and the least x for which it has a solution is 164, which is larger than 16, so it is a new record value. So 29 is a term of this sequence and 16 is the corresponding term of A341084, but 41 is not a term here because the least x for which x^2 - D*y^2 = -5 has a solution is not a record value.
From _Jon E. Schoenfield_, Feb 20 2021: (Start)
As D runs through the primes, the minimal x values satisfying the equation x^2 - D*y^2 = -5 begin as follows:
.
      x values satisfying    minimal
   D    x^2 - D*y^2 = -5     x value  record
  --  ---------------------  -------  ------
   2  (none)
   3  (none)
   5  0, 20, 360, 6460, ...      0       *
   7  (none)
  11  (none)
  13  (none)
  17  (none)
  19  (none)
  23  (none)
  29  16, 1524, 315156, ...     16       *
  31  (none)
  37  (none)
  41  6, 826, 25414, ...         6
  43  (none)
  47  (none)
  51  (none)
  53  (none)
  59  (none)
  61  164, 26924344, ...       164       *
  ...
The record high minimal values of x (marked with asterisks) are the terms of A341084. The corresponding values of D are the terms of this sequence. (End)
		

Crossrefs

Extensions

a(1)=5 inserted and Example section edited by Jon E. Schoenfield, Feb 20 2021
Showing 1-10 of 17 results. Next