I made a nested pure function
Nest[(x^2)/ ((2x+1) + #)&, x,n]
I would like that for each iteration the value of x increment of 1, to have something like
$$\frac{1^2}{\frac{3 + 2^2}{5 + ...}}$$
I'm wondering if this is possible?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityYou can use RecurrenceTable
.
RecurrenceTable[
{
f[x] == (x^2)/((2 x + 1) + f[x - 1])
, f[1] == 1/(1 + 3)
}
, f
, {x, 3}]
{1/4, 16/21, 189/163}
Hope this helps.
I'd be tempted to implement this as a recursion:
f[x_] := f[x] = (x^2)/((2 x + 1) + f[x - 1]);
f[1] = 1/4;
Now to get the first 10 values:
f/@ Range[10]
Fold[#2^2/((2*#2+1)+#1)&,x,Range[5]//Reverse]
? $\endgroup$HoldForm
, i.e.,Fold[HoldForm[#2^2]/((2*#2 + 1) + #1) &, x, Range[5, 1, -1]]
$\endgroup$a = 5 + 1; Nest[(a -= 1 ; a^2/((2*a + 1) + #)) &, x, a - 1]
$\endgroup$