login
A338629
Number of integers less than n with the same period of continued fraction for square root as n.
1
0, 0, 0, 1, 1, 1, 0, 2, 2, 2, 3, 4, 0, 1, 5, 3, 3, 6, 0, 7, 1, 2, 2, 8, 4, 4, 9, 3, 1, 10, 0, 4, 5, 6, 11, 5, 5, 12, 13, 14, 0, 15, 0, 1, 3, 0, 7, 16, 6, 6, 17, 4, 2, 5, 8, 18, 6, 0, 7, 9, 0, 10, 19, 7, 7, 20, 1, 21, 2, 8, 3, 22, 1, 3, 11, 1, 9, 12, 13, 23
OFFSET
1,8
LINKS
Eric Weisstein's World of Mathematics, Periodic Continued Fraction
FORMULA
a(n) = |{j < n : A003285(j) = A003285(n)}|.
EXAMPLE
a(11) = 3 because A003285(11) = 2 and also A003285(3) = A003285(6) = A003285(8) = 2.
More specifically,
sqrt(3) = 1 + 1/(1 + 1/(2 + 1/(1 + 1/(2 + ...)))),
sqrt(6) = 2 + 1/(2 + 1/(4 + 1/(2 + 1/(4 + ...)))),
sqrt(8) = 2 + 1/(1 + 1/(4 + 1/(1 + 1/(4 + ...)))),
sqrt(11) = 3 + 1/(3 + 1/(6 + 1/(3 + 1/(6 + ...)))).
MAPLE
f:= proc(n) if issqr(n) then 0 else nops(numtheory:-cfrac(sqrt(n), periodic, quotients)[2]) fi end proc:
V:= map(f, [$1..200]):
seq(numboccur(V[n], V[1..n-1]), n=1..200); # Robert Israel, Nov 06 2020
MATHEMATICA
Table[Length[Select[Range[n - 1], Module[{s = Sqrt[#]}, If[IntegerQ[s], 0, Length[ContinuedFraction[s][[2]]]]] == Module[{s = Sqrt[n]}, If[IntegerQ[s], 0, Length[ContinuedFraction[s][[2]]]]] &]], {n, 80}]
CROSSREFS
Cf. A003285.
Sequence in context: A327746 A348626 A124492 * A057646 A238892 A238279
KEYWORD
nonn,look
AUTHOR
Ilya Gutkovskiy, Nov 04 2020
STATUS
approved