OFFSET
1,2
EXAMPLE
The continued fraction for S(6) = 1+1/2+1/3+1/11+1/16+1/21 is [2, 29, 9, 1, 3, 3] which contains 6 elements. The continued fraction for 1+1/2+1/3+1/11+1/16+1/21+1/27 is [2, 14, 169, 1, 1, 1, 4] which contains 7 elements and 27 is the smallest number >21 with this property, hence a(7) = 27.
MATHEMATICA
seq[len_] := Module[{s = {}, sum = 1, t = 1}, Do[sum += 1/t; While[Length[ContinuedFraction[sum + 1/t]] != n, t++]; AppendTo[s, t], {n, 1, len}]; s]; seq[39] (* Amiram Eldar, Jun 05 2022 *)
PROG
(PARI) s=1; t=1; for(n=1, 38, s=s+1/t; while(abs(n-length(contfrac(s+1/t)))>0, t++); print1(t, ", "))
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Benoit Cloitre, May 19 2002
EXTENSIONS
One more term from Thomas Baruchel, Nov 16 2003
Name corrected and a(40) added by Amiram Eldar, Jun 05 2022
STATUS
approved