OFFSET
1,2
EXAMPLE
1/a(1)+1/a(2)+1/a(3)+1/a(4) = (1+1/3+1/27+1/51) which continued fraction is {1, 2, 1, 1, 3, 2, 1, 1, 4} and 1+2+1+1+3+2+1+1+4 = 16 = 4^2.
MATHEMATICA
a[1] = 1; a[n_] := a[n] = (s = Sum[1/a[i], {i, 1, n - 1}]; While[Plus @@ ContinuedFraction[s + 1/k] != n^2, k++ ]; k); k = 1; Do[ Print[ a[n]], {n, 1, 40}]
PROG
(PARI) s=1; t=1; for(n=2, 40, s=s+1/t; while(abs(n^2+1-sum(i=1, length(contfrac(s+1/t)), component(contfrac(s+1/t), i)))>0, t++); print1(t, ", "))
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Jun 10 2002
EXTENSIONS
Edited by Robert G. Wilson v, Jun 17 2002
STATUS
approved