OFFSET
1,3
LINKS
Jinyuan Wang, Table of n, a(n) for n = 1..1000
Gonzalo Ciruelos, Python script that generates a(1)..a(n)
EXAMPLE
The 7th harmonic number is 1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/7 = 363/140, which has the continued fraction representation 2 + 1/(1 + 1/(1 + 1/(2 + 1/(5 + 1/5)))) = [2;1,1,2,5,5]. There are exactly two 1's in the continued fraction representation, so a(7) = 2.
MATHEMATICA
Table[Count[ContinuedFraction[HarmonicNumber[n]], 1], {n, 100}] (* Harvey P. Dale, Nov 24 2016 *)
PROG
(PARI) a(n) = #select(x->x==1, contfrac(sum(i=1, n, 1/i))); \\ Jinyuan Wang, Mar 01 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, May 31 2008
EXTENSIONS
a(10)-a(15) from Gonzalo Ciruelos, Aug 02 2013
Corrected and extended by Harvey P. Dale, Nov 24 2016
STATUS
approved