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.

A033314 Least D in the Pellian x^2 - D*y^2 = 1 for which x has least solution n.

Original entry on oeis.org

3, 2, 15, 6, 35, 12, 7, 5, 11, 30, 143, 42, 195, 14, 255, 18, 323, 10, 399, 110, 483, 33, 23, 39, 27, 182, 87, 210, 899, 60, 1023, 17, 1155, 34, 1295, 38, 1443, 95, 1599, 105, 1763, 462, 215, 506, 235, 138, 47, 96, 51, 26, 2703, 78, 2915, 21, 3135, 203, 3363
Offset: 2

Views

Author

Keywords

Comments

The i-th solution pair V(i) = [x(i), y(i)] to the Pellian x^2 - D*y^2 = 1 for a given least solution x(1) = n may be generated through the recurrence V(i+2) = 2*n*V(i+1) - V(i) taking V(0) = [1, 0] and V(1) = [n, sqrt((n^2-1)/a(n))]. V(i) stands for the numerator and denominator of the 2i-th convergent of the continued fraction expansion of sqrt(D).
Thus setting n = 3, for instance, we have D = a(3) = 2 and V(1) = [3, 2] so that along with V(0) = [1, 0] recurrence V(i+2) = 6*V(i+1) - V(i) generates [A001333(2k), A000129(2k)]. Similarly, setting n = 9 generates [A023039, A060645], respectively the numerator and denominator of the 2i-th convergent of sqrt(a(9)), i.e., sqrt(5). - Lekraj Beedassy, Feb 26 2002

Crossrefs

Programs

  • Mathematica
    squarefreepart[n_] :=
      Times @@ Power @@@ ({#[[1]], Mod[#[[2]], 2]} & /@ FactorInteger[n]);
    pellminx[d_] := Module[{q, p, z}, {q, p} = ContinuedFraction[Sqrt[d]];
      If[OddQ[p // Length], p = Join[p, p]];
      z = FromContinuedFraction[Join[{q}, Drop[p, -1]]]; Numerator[z]]
    NMAX = 60; a = {};
    For[n = 2, n <= NMAX, n++, s = squarefreepart[n^2 - 1];
    sd = s Divisors[Sqrt[(n^2 - 1)/s]]^2;
    t = Sort[Transpose[{sd, pellminx[#] & /@ sd}]];
    AppendTo[a, Select[t, #[[2]] == n &, 1][[1, 1]]]
    ]; a (* Herbert Kociemba, Jun 05 2022 *)