A033314 Least D in the Pellian x^2 - D*y^2 = 1 for which x has least solution n.
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
Keywords
Links
- Ray Chandler, Table of n, a(n) for n = 2..1001
- Eric Weisstein's World of Mathematics, Pell Equation.
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 *)
Comments