OFFSET
1,2
EXAMPLE
The continued fraction for S(5) = 1 + 1/9 + 1/156 + 1/1696 + 1/3974 is [1, 8, 2, 4, 2, 1, 2, 1, 5, 4, 1, 3, 2, 243, 1, 1, 3] where the largest element is 243=3^5 and 3974 is the smallest integer >1696 with this property.
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Block[{k = a[n - 1] + 1, s = Plus @@ (1/Table[a[i], {i, n - 1}])}, While[Log[3, Max[ContinuedFraction[s + 1/k]]] != n, k++ ]; k]; Do[ Print[ a[n]], {n, 11}] (* Robert G. Wilson v, Aug 08 2005 *)
PROG
(PARI) s=1; t=1; for(n=2, 50, s=s+1/t; while(abs(3^n-vecmax(contfrac(s+1/t)))>0, t++); print1(t, ", "))
CROSSREFS
KEYWORD
hard,nonn
AUTHOR
Ryan Propper, Aug 06 2005
STATUS
approved