|
|
A033313
|
|
Smallest positive integer x satisfying the Pell equation x^2 - D*y^2 = 1 for nonsquare D and positive y.
|
|
25
|
|
|
3, 2, 9, 5, 8, 3, 19, 10, 7, 649, 15, 4, 33, 17, 170, 9, 55, 197, 24, 5, 51, 26, 127, 9801, 11, 1520, 17, 23, 35, 6, 73, 37, 25, 19, 2049, 13, 3482, 199, 161, 24335, 48, 7, 99, 50, 649, 66249, 485, 89, 15, 151, 19603, 530, 31, 1766319049, 63, 8, 129, 65, 48842, 33
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
F:= proc(d) local r, Q; uses numtheory;
Q:= cfrac(sqrt(d), 'periodic', 'quotients'):
r:= nops(Q[2]);
if r::odd then
numer(cfrac([op(Q[1]), op(Q[2]), op(Q[2][1..-2])]))
else
numer(cfrac([op(Q[1]), op(Q[2][1..-2])]));
fi
end proc:
|
|
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]}];
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 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|