There is documentation about the
rsolve command here.
In this one there are 20 iterations and the number to start from is 7, I am not sure why they are starting with 7 in this particular example.
Let's look at this line: { f(n) = f(n-1) + 9, f(0)=7};
The first comma-delimited part is the formula, the second part just defines the starting number. so the f(n) = f(n-1) is the key to the recursion in this case. All it is saying is that the current iteration is equal to the prior iteration, then you have the + 9 which means the new iteration is equal to the old iteration plus 9.
Next line is rsolve(%,f(k));
Not exactly sure what the % signifies, I am guessing it is just a callback to the previous line since that is the spot for the expression for recursion. The second part seems to be the key to iterations. From a programming standpoint, I see f(n) as an array, the f(k) which is pulling iterations from the seq command is specifying which iteration of the array is current.
seq( subs(k = j, %), j = 0..20);
the % is a callback again. From what I can gather, the subs command (substitution) is needed due to j being assigned to a sequence, so it needs a new variable in order to specify the current value.
So if you just wanted to do a simple recursion of +1 addition of whole numbers for 10 iterations starting at 0 you could use:
rsolve( { f(n) = f(n-1)+1, f(0)=0 }, f(k) );
seq(subs(k=j,%), j=0..10);
I would assume the fibonacci numbers for 10 iterations (requires 2nd order recursion) would go something like this:
rsolve( { f(n) = f(n-1)+f(n-2), f(0)=0, f(1)=1}, f(k) );
seq(subs(k=j,%), j=0..10);