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.

Original entry on oeis.org

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, 6, 1, 12, 6, 4, 3, 320, 2, 531, 30, 24, 3588, 7, 1, 14, 7, 90, 9100, 66, 12, 2, 20, 2574, 69, 4, 226153980, 8, 1, 16, 8, 5967, 4, 936, 30, 413, 2, 267000, 430, 3, 6630, 40, 6, 9
Offset: 1

Views

Author

Keywords

Comments

D = D(n) = A000037(n). - Wolfdieter Lang, Oct 04 2015

Crossrefs

Cf. A000037, A033313 (for the x's), A077232, A077233.

Programs

  • Maple
    F:= proc(d) local r,Q; uses numtheory;
      Q:= cfrac(sqrt(d),'periodic','quotients'):
      r:= nops(Q[2]);
      if r::odd then
        denom(cfrac([op(Q[1]),op(Q[2]),op(Q[2][1..-2])]))
      else
        denom(cfrac([op(Q[1]),op(Q[2][1..-2])]));
      fi
    end proc:
    map(F, remove(issqr,[$1..100])); # Robert Israel, May 17 2015
  • 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 = 2n]; s = FromContinuedFraction[ContinuedFraction[Sqrt[m], n]]; {Numerator[s], Denominator[s]}];
    A033317 = DeleteCases[PellSolve /@ Range[100], {}][[All, 2]] (* Jean-François Alcover, Nov 21 2020, after N. J. A. Sloane in A002349 *)

Formula

a(n) = sqrt((A033313(n)^2 - 1)/A000037(n)). - Jinyuan Wang, Jul 09 2020