The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.



(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A033313 Smallest positive integer x satisfying the Pell equation x^2 - D*y^2 = 1 for nonsquare D and positive y. 24


%S 3,2,9,5,8,3,19,10,7,649,15,4,33,17,170,9,55,197,24,5,51,26,127,9801,

%T 11,1520,17,23,35,6,73,37,25,19,2049,13,3482,199,161,24335,48,7,99,50,

%U 649,66249,485,89,15,151,19603,530,31,1766319049,63,8,129,65,48842,33

%N Smallest positive integer x satisfying the Pell equation x^2 - D*y^2 = 1 for nonsquare D and positive y.

%H Charles R Greathouse IV, <a href="/A033313/b033313.txt">Table of n, a(n) for n = 1..10000</a>

%H S. R. Finch, <a href="/A000924/a000924.pdf">Class number theory</a> [Cached copy, with permission of the author]

%H H. W. Lenstra, jr., <a href="http://www.ams.org/notices/200202/fea-lenstra.pdf">Solving the Pell Equation</a>

%H F. Richman & R. Mines, <a href="http://math.fau.edu/richman/pell-m.htm">Pell's equation</a>

%H Derek Smith, <a href="http://web.archive.org/web/20051125023958/http://www.lacim.uqam.ca/~plouffe/OEIS/archive_in_pdf/HistoricalPell.pdf">Historical Overview of Pell Equations</a>

%H Derek Smith, <a href="http://web.archive.org/web/20141029065638/http://www.plouffe.fr/simon/OEIS/archive_in_pdf/pellequations.pdf">The Search For An Exhaustive Solution to Pell's Equation</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PellEquation.html">Pell Equation</a>

%F a(n) = sqrt(1 + A000037(n)*A033317(n)^2), or

%F a(n) = sqrt(1 + (n + floor(1/2 + sqrt(n)))*A033317(n)^2). - _Zak Seidov_, Oct 24 2013

%p F:= proc(d) local r,Q; uses numtheory;

%p Q:= cfrac(sqrt(d),'periodic','quotients'):

%p r:= nops(Q[2]);

%p if r::odd then

%p numer(cfrac([op(Q[1]),op(Q[2]),op(Q[2][1..-2])]))

%p else

%p numer(cfrac([op(Q[1]),op(Q[2][1..-2])]));

%p fi

%p end proc:

%p map(F, remove(issqr,[$1..100])); # _Robert Israel_, May 17 2015

%t PellSolve[(m_Integer)?Positive] := Module[{cf, n, s}, cf = ContinuedFraction[Sqrt[m]]; n = Length[Last[cf]]; If[n == 0, Return[{}]]; If[OddQ[n], n = 2n]; s = FromContinuedFraction[ContinuedFraction[Sqrt[m], n]]; {Numerator[s], Denominator[s]}];

%t A033313 = DeleteCases[PellSolve /@ Range[100], {}][[All, 1]] (* _Jean-Fran├žois Alcover_, Nov 21 2020, after _N. J. A. Sloane_ in A002350 *)

%Y See A033317 (for y's).

%Y Cf. A000037, A002350, A077232, A077233.

%K nonn

%O 1,1

%A _Eric W. Weisstein_

%E Offset switched to 1 by _R. J. Mathar_, Sep 21 2009

%E Name corrected by _Wolfdieter Lang_, Sep 03 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 2 06:13 EST 2021. Contains 341742 sequences. (Running on oeis4.)