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 16 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

A033316 Value of D for incrementally largest values of minimal x satisfying Pell equation x^2-Dy^2=1.

Original entry on oeis.org

1, 2, 5, 10, 13, 29, 46, 53, 61, 109, 181, 277, 397, 409, 421, 541, 661, 1021, 1069, 1381, 1549, 1621, 2389, 3061, 3469, 4621, 4789, 4909, 5581, 6301, 6829, 8269, 8941, 9949, 12541, 13381, 16069, 17341, 24049, 24229, 25309, 29269, 30781, 32341, 36061
Offset: 1

Views

Author

Keywords

Comments

Equally, value of D for incrementally largest values of minimal y satisfying Pell equation x^2-Dy^2=1.
Values of n where A002349 (or A002350) sets a new record.

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]; a = b = -1; t = {}; Do[b = f[n]; If[b > a, t = Append[t, n]; a = b], {n, 1, 40500}]; t

Extensions

More terms from Robert G. Wilson v, Apr 15 2003

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

A336793 Incrementally largest values of minimal positive y satisfying the equation x^2 - D*y^2 = -2, where D is an odd prime number.

Original entry on oeis.org

1, 3, 9, 27, 747, 36321, 2900979, 5843427, 563210019, 11516632737, 48957047673, 953426773899, 23440805582361, 27491112569139, 734940417828177, 1270701455204457, 106719437154440984241, 292398373544007804918339, 62392836359922644036329593, 607918712560763608313068257
Offset: 1

Views

Author

Christine Patterson, Oct 14 2020

Keywords

Comments

For the corresponding numbers D see A336792.

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 A336792 and 3 is a term of this sequence.
		

Crossrefs

A336787 Incrementally largest values of minimal x satisfying the equation x^2 - D*y^2 = 2, where D is a prime number.

Original entry on oeis.org

2, 3, 5, 39, 59, 477, 2175, 41571, 127539, 340551, 15732537, 221272626669, 2700614460969, 66944775830061, 616049024759241, 6245844517335369, 13085071811371140879, 43795350588094552821, 63464174140920940599, 633160367499665048108061
Offset: 1

Views

Author

Christine Patterson, Aug 05 2020

Keywords

Comments

Analogous to A033315 for x^2 - D*y^2 = 1, and D required to be prime. The x values incrementally largest for x^2 - D*y^2 = 2. D values appear in sequence A336786.

Examples

			For D=31, the least x for which x^2 - Dy^2 = 2 has a solution is 39. The next prime, D, for which x^2 - Dy^2 = 2 has a solution is 47, but the smallest x in this case is 7, which is less than 39. The next prime, D, after 47 for which x^2 - Dy^2 = 2 has a solution is 71 and the least x for which it has a solution is x=59, which is larger than 39, a new record value, so 71 is a term of A336786 and 59 is the corresponding term of this sequence. 47 is not a term of A336786 because the least x for which x^2 - 47*y^2 = 2 has a solution is not a record value.
From _Jon E. Schoenfield_, Feb 24 2021: (Start)
Primes D for which the equation x^2 - D*y^2 = 2 has integer solutions begin 2, 7, 23, 31, 47, 71, 79, 103, ...; at those values of D, the minimal x values satisfying the equation x^2 - D*y^2 = 2 begin as follows:
.
           x values satisfying      minimal
    D        x^2 - D*y^2 = 2        x value  record
  ---  ---------------------------  -------  ------
    2  2, 10, 58, 338, 1970, ...        2      *
    7  3, 45, 717, 11427, ...           3      *
   23  5, 235, 11275, 540965, ...       5      *
   31  39, 118521, 360303801, ...      39      *
   47  7, 665, 63833, 6127303, ...      7
   71  59, 410581, 2857643701, ...     59      *
   79  9, 1431, 228951, ...             9
  103  477, 217061235, ...            477      *
  ...
The record high minimal values of x (marked with asterisks) are the terms of this sequence. The corresponding values of D are the terms of A336786. (End)
		

Crossrefs

Extensions

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

A336791 Incrementally largest values of minimal x satisfying the equation x^2 - D*y^2 = -2, where D is an odd prime number.

Original entry on oeis.org

1, 3, 13, 59, 221, 8807, 527593, 52778687, 113759383, 13458244873, 313074529583, 1434867510253, 30909266676193, 842239594152347, 1075672117707143, 29204057639975683, 52376951398984393, 4785745078256208692917, 15280437983663153103594943
Offset: 1

Views

Author

Christine Patterson, Oct 14 2020

Keywords

Comments

Analogous to A033315 for x^2-D*y^2=1, and D required to be prime.

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 A336790 and 221 is a term of this sequence, but 59 is not a term of A336790 because the least x for which x^2-47*y^2=-2 has a solution at D=59 is not a record value.
		

Crossrefs

Programs

  • Mathematica
    records[n_]:=Module[{ri=n,m=0,rcs={},len},len=Length[ri];While[ len>0,If[ First[ri]>m,m=First[ri];AppendTo[rcs,m]]; ri=Rest[ri]; len--];rcs]; records[ Abs[Flatten[Table[x/.FindInstance[x^2-p y^2==-2,{x,y},Integers],{p,Prime[Range[2,500]]}]/.x->Nothing]]] (* Harvey P. Dale, Jan 02 2022 *)

A336795 Incrementally largest values of minimal x satisfying the equation x^2 - D*y^2 = 3, where D is a prime number.

Original entry on oeis.org

4, 8, 94, 9532, 289580, 3433342, 57427216, 1610590723242832, 422208570755689121370258391432928, 112180929726349239798469275333193570657564148, 8590101469813781580594707823194303692816416722
Offset: 1

Views

Author

Christine Patterson, Jan 17 2021

Keywords

Comments

Analogous to A033315 for x^2 - D*y^2 = 1, and D required to be prime.

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 94. 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 94, so it is a new record value. 73 is a term of A336794 and 94 is a term of this sequence, but 97 is not a term of A336794 because the least x for which x^2 - 97*y^2 = 3 has a solution is not a record value.
		

Crossrefs

Extensions

Example section edited by Jon E. Schoenfield, Feb 23 2021

A336800 Incrementally largest values of minimal y satisfying the equation x^2 - D*y^2 = 3, where D is a prime number.

Original entry on oeis.org

1, 11, 913, 23111, 221161, 3450467, 78495388880651, 10727569485920362724490720830137, 2027623752997677729366859925491727716361771, 127194478138610620242010764302143341359067289, 264781463133512691674640873276575271478272395041
Offset: 1

Views

Author

Christine Patterson, Feb 04 2021

Keywords

Examples

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

Crossrefs

A341076 Incrementally largest values of minimal x satisfying the equation x^2 - D*y^2 = -3, where D is a prime number.

Original entry on oeis.org

0, 2, 7, 11, 13, 5639, 11262809, 1538763335, 126460946201, 1276182285427369, 14786648025753749026871, 105410978030726984449289, 1498381179129960066289070257961, 107744062788861651804382809216696729188191, 2525173635632697805707745894621283442852191
Offset: 1

Views

Author

Christine Patterson, Feb 04 2021

Keywords

Comments

Analogous to A033315 for x^2 - D*y^2 = 1, and D required to be prime.

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. x=11 is a term of this sequence and the corresponding value D=31 is a term of A336801, but 19 is not a term there because the least x for which x^2 - D*y^2 = -3 has a solution at D=19 is not a record value.
From _Jon E. Schoenfield_, Feb 23 2021: (Start)
As D runs through the primes, the minimal x values satisfying the equation x^2 - D*y^2 = -3 begin as follows:
.
       x values satisfying    minimal
   D     x^2 - D*y^2 = -5     x value  record
  --  ----------------------  -------  ------
   2  (none)
   3  0, 3, 12, 45, 168, ...      0      *
   5  (none)
   7  2, 5, 37, 82, 590, ...      2      *
  11  (none)
  13  7, 137, 9223, ...           7      *
  17  (none)
  19  4, 61, 1421, ...            4
  23  (none)
  29  (none)
  31  11, 206, 33646, ...        11      *
  37  (none)
  41  (none)
  43  13, 400, 90932, ...        13      *
  ...
The record high minimal values of x (marked with asterisks) are the terms of this sequence. The corresponding values of D are the terms of A336801. (End)
		

Crossrefs

Extensions

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