login
A028832
Number of distinct integers in period of continued fraction for sqrt(n), or 0 if n is a square.
6
0, 1, 2, 0, 1, 2, 2, 2, 0, 1, 2, 2, 2, 3, 2, 0, 1, 2, 4, 2, 3, 4, 3, 2, 0, 1, 2, 3, 3, 2, 4, 2, 3, 3, 2, 0, 1, 2, 2, 2, 2, 2, 4, 3, 3, 5, 3, 2, 0, 1, 2, 4, 3, 4, 2, 2, 3, 2, 4, 3, 5, 3, 2, 0, 1, 2, 5, 2, 4, 3, 4, 2, 3, 2, 2, 5, 4, 3, 3, 2, 0, 1, 2, 2, 3, 4, 2, 3, 3, 2, 3, 4, 4, 6, 3, 3, 3, 3, 2, 0, 1, 2
OFFSET
1,3
LINKS
MATHEMATICA
a[n_] := If[IntegerQ @ Sqrt[n], 0, Length @ DeleteDuplicates @ ContinuedFraction[Sqrt[n]][[2]]]; Array[a, 100] (* Amiram Eldar, Nov 10 2021 *)
CROSSREFS
Cf. A054269.
Sequence in context: A084665 A035392 A007149 * A260411 A199331 A243917
KEYWORD
nonn
STATUS
approved