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.

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

This page as a plain text file.
%I A033317 #55 Feb 16 2025 08:32:36
%S A033317 2,1,4,2,3,1,6,3,2,180,4,1,8,4,39,2,12,42,5,1,10,5,24,1820,2,273,3,4,
%T A033317 6,1,12,6,4,3,320,2,531,30,24,3588,7,1,14,7,90,9100,66,12,2,20,2574,
%U A033317 69,4,226153980,8,1,16,8,5967,4,936,30,413,2,267000,430,3,6630,40,6,9
%N A033317 Smallest positive integer y satisfying the Pell equation x^2 - D*y^2 = 1 for nonsquare D.
%C A033317 D = D(n) = A000037(n). - _Wolfdieter Lang_, Oct 04 2015
%H A033317 Charles R Greathouse IV, <a href="/A033317/b033317.txt">Table of n, a(n) for n = 1..10000</a>
%H A033317 Laurent Beeckmans, <a href="http://www.jstor.org/stable/2974904">Squares Expressible as Sum of Consecutive Squares</a>, Am. Math. Monthly, Volume 101, Number 5, page 442, May 1994.
%H A033317 S. R. Finch, <a href="/A000924/a000924.pdf">Class number theory</a> [Cached copy, with permission of the author]
%H A033317 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 B page 19.
%H A033317 N. J. A. Sloane et al., <a href="https://oeis.org/wiki/Binary_Quadratic_Forms_and_OEIS">Binary Quadratic Forms and OEIS</a> (Index to related sequences, programs, references)
%H A033317 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PellEquation.html">Pell Equation</a>
%F A033317 a(n) = sqrt((A033313(n)^2 - 1)/A000037(n)). - _Jinyuan Wang_, Jul 09 2020
%p A033317 F:= proc(d) local r,Q; uses numtheory;
%p A033317   Q:= cfrac(sqrt(d),'periodic','quotients'):
%p A033317   r:= nops(Q[2]);
%p A033317   if r::odd then
%p A033317     denom(cfrac([op(Q[1]),op(Q[2]),op(Q[2][1..-2])]))
%p A033317   else
%p A033317     denom(cfrac([op(Q[1]),op(Q[2][1..-2])]));
%p A033317   fi
%p A033317 end proc:
%p A033317 map(F, remove(issqr,[$1..100])); # _Robert Israel_, May 17 2015
%t A033317 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 A033317 A033317 = DeleteCases[PellSolve /@ Range[100], {}][[All, 2]] (* _Jean-François Alcover_, Nov 21 2020, after _N. J. A. Sloane_ in A002349 *)
%Y A033317 Cf. A000037, A033313 (for the x's), A077232, A077233.
%K A033317 nonn
%O A033317 1,1
%A A033317 _Eric W. Weisstein_