[go: up one dir, main page]

login
A031526
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 28.
0
786, 802, 822, 834, 838, 862, 866, 878, 886, 898, 1767, 1797, 1803, 1812, 1821, 1833, 1839, 1857, 1884, 1893, 1911, 1929, 1941, 1956, 1977, 1983, 2013, 2022, 3140, 3148, 3180, 3188, 3196, 3212, 3228, 3236, 3244, 3260, 3276, 3284, 3292, 3308, 3316, 3340
OFFSET
1,1
MATHEMATICA
okQ[n_] := Module[{cf, p}, cf = ContinuedFraction[Sqrt[n]]; p = FindTransientRepeat[cf, 2][[1, 2]]; EvenQ[lp = Length[p]] && p[[lp/2]] == 28];
Reap[Do[If[okQ[n], Sow[n]], {n, 1, 3340}]][[2, 1]] // Quiet (* Jean-François Alcover, Dec 14 2017 *)
cf28Q[n_]:=Module[{s=Sqrt[n], cf, len}, cf=If[IntegerQ[s], {1}, ContinuedFraction[ s][[2]]]; len=Length[cf]; EvenQ[len]&&cf[[len/2]] == 28]; Select[ Range[3400], cf28Q] (* Harvey P. Dale, Jun 03 2021 *)
CROSSREFS
Sequence in context: A159896 A031734 A097776 * A108795 A097774 A031896
KEYWORD
nonn
STATUS
approved