Niles
- 1,834
- 0
Hi
I am trying to find a smart way to write the following fraction,
$$
F = \frac{a_1}{1+\frac{a_2}{1+\frac{a_3}{1+a_4}}}
$$
Here we can just take a_n= n for simplicity. My fraction is in principle infinite, but I am trying to construct a function which can find F for a given n recursively. I haven't had much success. So far I have
which is the last term for a given n. For do I propagate all the way up to a_1 then?
I am trying to find a smart way to write the following fraction,
$$
F = \frac{a_1}{1+\frac{a_2}{1+\frac{a_3}{1+a_4}}}
$$
Here we can just take a_n= n for simplicity. My fraction is in principle infinite, but I am trying to construct a function which can find F for a given n recursively. I haven't had much success. So far I have
f[n_] := n;
f[n - 1]/(1 + f[n])
which is the last term for a given n. For do I propagate all the way up to a_1 then?