I'm trying to use RSolve
as follows to solve a recurrence relation:
RSolve[{a[0] == 1, a[2 n + 1] == a[2 n]*2, a[2 n] == a[2 n - 1] + 2}, a, n]
I think the meaning of the relation is clear: for odd terms in the sequence, multiply the previous term by two, and for even terms, add two to the previous term.
However, when evaluating this, Mathematica simply echos the input:
rather than attempting to solve the recurrence.
I can't find anything in the RSolve documentation which talks about cases where RSolve will do nothing, without any error message.
Have I made a syntax error, or does this mean that Mathematica is not able to solve this type of recurrence relation? How can I change my input so that Mathematica does solve the recurrence, assuming it is possible?
RSolve
(a
) witha[n]
. $\endgroup$RSolve[{a[0] == 1, a[1 + 2 n] == 2 a[2 n], a[2 n] == 2 + a[-1 + 2 n]}, a[n], n]
$\endgroup$