OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
The c.f. expansion of sqrt(127) is 11, [3, 1, 2, 2, 7, 11, 7, 2, 2, 1, 3, 22], [3, 1, 2, 2, 7, 11, 7, 2, 2, 1, 3, 22], ... If the 22 is deleted from the periodic part the central term is 11. - N. J. A. Sloane, Aug 17 2021
MAPLE
# Maple 2016 or later.
filter:= proc(n) uses NumberTheory; local R;
if issqr(n) then return false fi;
R:= Term(ContinuedFraction(sqrt(n)), periodic)[2];
nops(R)::even and R[nops(R)/2] = 11
end proc:
select(filter, [$2..10000]); # Robert Israel, Jun 07 2019
MATHEMATICA
okQ[k_] := Module[{c, lc}, If[IntegerQ[Sqrt[k]], False,
c = ContinuedFraction[Sqrt[k]]; lc = Length[c[[2]]];
EvenQ[lc] && c[[2, lc/2]] == 11]];
Select[Range[10000], okQ] (* Jean-François Alcover, Jul 09 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
STATUS
approved