- #1
Niles
- 1,866
- 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 [itex]a_n= n[/itex] for simplicity. My fraction is in principle infinite, but I am trying to construct a function which can find [itex]F[/itex] for a given [itex]n[/itex] recursively. I haven't had much success. So far I have
which is the last term for a given [itex]n[/itex]. For do I propagate all the way up to [itex]a_1[/itex] 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 [itex]a_n= n[/itex] for simplicity. My fraction is in principle infinite, but I am trying to construct a function which can find [itex]F[/itex] for a given [itex]n[/itex] 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 [itex]n[/itex]. For do I propagate all the way up to [itex]a_1[/itex] then?