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.

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

This page as a plain text file.
%I A033313 #150 Feb 16 2025 08:32:36
%S A033313 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 A033313 11,1520,17,23,35,6,73,37,25,19,2049,13,3482,199,161,24335,48,7,99,50,
%U A033313 649,66249,485,89,15,151,19603,530,31,1766319049,63,8,129,65,48842,33
%N A033313 Smallest positive integer x satisfying the Pell equation x^2 - D*y^2 = 1 for nonsquare D and positive y.
%H A033313 Charles R Greathouse IV, <a href="/A033313/b033313.txt">Table of n, a(n) for n = 1..10000</a>
%H A033313 S. R. Finch, <a href="/A000924/a000924.pdf">Class number theory</a> [Cached copy, with permission of the author]
%H A033313 Bernard Frénicle de Bessy, <a href="https://gallica.bnf.fr/ark:/12148/bpt6k3187867/f33.item">Solutio duorum problematum circa numeros cubos et quadratos</a>, (1657). Bibliothèque Nationale de Paris. See column C page 19.
%H A033313 H. W. Lenstra, jr., <a href="http://www.ams.org/notices/200202/fea-lenstra.pdf">Solving the Pell Equation</a>, Notices of the AMS, Vol.49, No.2, Feb. 2002, p.182-192.
%H A033313 F. Richman and R. Mines, <a href="http://math.fau.edu/richman/pell-m.htm">Pell's equation</a>
%H A033313 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 A033313 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 A033313 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PellEquation.html">Pell Equation</a>
%F A033313 a(n) = sqrt(1 + A000037(n)*A033317(n)^2), or
%F A033313 a(n) = sqrt(1 + (n + floor(1/2 + sqrt(n)))*A033317(n)^2). - _Zak Seidov_, Oct 24 2013
%p A033313 F:= proc(d) local r,Q; uses numtheory;
%p A033313   Q:= cfrac(sqrt(d),'periodic','quotients'):
%p A033313   r:= nops(Q[2]);
%p A033313   if r::odd then
%p A033313     numer(cfrac([op(Q[1]),op(Q[2]),op(Q[2][1..-2])]))
%p A033313   else
%p A033313     numer(cfrac([op(Q[1]),op(Q[2][1..-2])]));
%p A033313   fi
%p A033313 end proc:
%p A033313 map(F, remove(issqr,[$1..100])); # _Robert Israel_, May 17 2015
%t A033313 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 A033313 = DeleteCases[PellSolve /@ Range[100], {}][[All, 1]] (* _Jean-François Alcover_, Nov 21 2020, after _N. J. A. Sloane_ in A002350 *)
%t A033313 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 28 2021 *)
%Y A033313 See A033317 (for y's).
%Y A033313 Cf. A000037, A002350, A077232, A077233.
%K A033313 nonn
%O A033313 1,1
%A A033313 _Eric W. Weisstein_
%E A033313 Offset switched to 1 by _R. J. Mathar_, Sep 21 2009
%E A033313 Name corrected by _Wolfdieter Lang_, Sep 03 2015