I'm a bit stuck on how to convert a non-recursive formula.
Assuming:
f(0) = 0
f(1) = 0
f(n) = f(n - 2) + $2^{n-1}\ if\ n \ge 1$
I can see that:
f(2) = 0 + $2^{2-1}$
f(3) = 0 + $2^{3-1}$
f(4) = (0 + $2^{2-1})\ +\ 2^{4-1}$
f(5) = (0 + $2^{3-1})\ +\ 2^{5-1}$
f(6) = ((0 + $2^{2-1})\ +\ 2^{4-1}) + 2^{6-1}$
f(7) = ((0 + $2^{3-1})\ +\ 2^{5-1}) + 2^{7-1}$
therefore the pattern appears to fit:
f(n) = $2^1 + 2^3 + ... + 2^{n-3} + 2^{n - 1} \ \ \ \ \ if\ n = even$
f(n) = $2^2 + 2^4 + ... + 2^{n-3} + 2^{n - 1} \ \ \ \ \ if\ n = odd$
I can understand how to write this as a sum of $\sum_{k=1}^n2^k$ or $\sum_{k=2}^n2^k$, however how do I convert this to a non-recursive formula if the variable being changed is used as the exponent.