login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A031598
Numbers k such that the continued fraction for sqrt(k) has even period and if the last term of the periodic part is deleted the central term is 100.
2
10002, 10006, 10018, 10022, 10046, 10054, 10078, 10082, 10086, 10102, 10118, 10134, 10146, 10162, 10174, 10178, 10182, 10194, 10198, 10214, 10226, 10238, 10274, 10278, 10294, 10306, 10326, 10334, 10338, 10342, 10358, 10402, 22503, 22521, 22548, 22557
OFFSET
1,1
MATHEMATICA
cf100Q[n_]:=Module[{s=Sqrt[n], cf, len}, cf=If[IntegerQ[s], {1}, ContinuedFraction[s][[2]]]; len= Length[ cf]; EvenQ[len]&&cf[[(len)/2]]==100]; Select[Range[23000], cf100Q]
PROG
(Python)
from __future__ import division
from sympy import continued_fraction_periodic
A031598_list = [n for n, s in ((i, continued_fraction_periodic(0, 1, i)[-1]) for i in range(1, 10**5)) if isinstance(s, list) and len(s) % 2 == 0 and s[len(s)//2-1] == 100] # Chai Wah Wu, Jun 10 2017
CROSSREFS
Sequence in context: A364050 A360574 A330135 * A210760 A164968 A165296
KEYWORD
nonn
EXTENSIONS
Definition corrected by Harvey P. Dale, Jul 13 2023
STATUS
approved