so I have this recursive function here:
$\forall n>1,f(n) = 2(f(n-1)) + n-1$, (where it is $0$ when $n$ is less than $1$)
So I have tried to use iteration for this but it just gets more complicated as I go on, so can anyone help me out here? Thanks so much! Sorry for the bad format as I am new here. Cheers!
Start noting, using recursion, that $$f(n)=2f(n-1)+(n-1)=2^2 f(n-2)+2(n-2)+(n-1)=$$ $$2^3 f(n-3)+2^2(n-3)+2^1(n-2)+(n-1)=...$$ So you should be able to prove (using induction, maybe) that $$f(n)=2^{n-1} f(1)+\sum_{i=1}^{n-1} 2^{i-1}(n-i)$$ Now $$\sum_{i=1}^{n-1} 2^{i-1}(n-i)=\sum_{i=1}^{n-1} 2^{i-1} n -i2^{i-1}=n\sum_{i=1}^{n-1} 2^{i-1}-\sum_{i=1}^{n-1} i2^{i-1}$$
Once again, the first sum is geometric. For the other addend, you can work it this way:
$$S_n:=\sum_{i=1}^n i2^{i}$$ $$2S_n=\sum_{i=1}^n i2^{i+1}=\sum_{i=2}^{n+1}(i-1)2^n=\sum_{i=2}^{n+1}i2^n-\sum_{i=2}^{n+1}2^i=S_n-2+(n+1)2^{n+1}-\sum_{i=2}^{n+1}2^i$$ So $$S_n=(2S_n-S_n)=(n+1)2^{n+1}-2+\sum_{i=2}^{n+1}2^i$$
If I didn't write something wrong somewhere, this is a sketch of how to deal with it. You should now write the explicit result for the geometric sums and you'll be pretty much ok.