f(1)=1, and f(n) = f(n-1)+2(n-1)
Using substitution, here are the first few steps: f(n-1) = f((n-1)-1) + 2((n-1)-1)
f(n-1-1) = f((n-1-1)-1-1) + 2((n-1-1)-1-1)
And then eventually I see that f(n+(-1)*2^j) = f(n+(-1)*2^(j+1)) + 2n + 2(-1)*2^(j+1), where j is an increasing integer >=1
What do I do now? It looks like 2(-1)*2^(j+1) will diverge to negative infinity...
The answer is f(n) = (n-1)n + 1 (using wolfram) but i have no idea what they did..