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”).

A010340
Sum of terms in period of continued fraction for sqrt(n).
7
0, 2, 3, 0, 4, 6, 7, 5, 0, 6, 9, 8, 10, 10, 7, 0, 8, 12, 17, 10, 14, 18, 13, 9, 0, 10, 15, 18, 16, 12, 25, 13, 14, 16, 11, 0, 12, 18, 16, 15, 16, 14, 29, 20, 20, 34, 19, 13, 0, 14, 21, 26, 22, 26, 20, 16, 22, 20, 27, 18
OFFSET
1,2
COMMENTS
The entry for a perfect square is 0.
MATHEMATICA
f[n_] := If[ IntegerQ[ Sqrt[n]], 0, Apply[ Plus, Last[ ContinuedFraction[ Sqrt[n]]]]]; Table[ f[n], {n, 1, 100} ]
CROSSREFS
Sequence in context: A133637 A258093 A286578 * A049275 A121598 A375417
KEYWORD
nonn,nice
AUTHOR
N. J. A. Sloane, Walter Gilbert
STATUS
approved