I'm trying to prove the following recurrence:
$g(n) = 3g(n-1) + 2$
$g(0) = 0$
$g(1) = 2$
$g(2) = 8$
...
I know that $g(n)$ in closed form is equal to $n^3 -1$, but I'm having a hard time proving it by induction. Here's what I've done so far:
$g(n) = 3[g(n-1)] + 2 = 3[(n -1)^3 -1] + 2 = 3(n - 1)^3 -1$
After the last step I get stuck, since clearly $3(n-1)^3$ is not equal to $n^3$.
Any help is greatly appreciated.
If $g(n)=3^n-1$ then we get recurrence
$$g(n+1)=3^{n+1}-1=3\cdot3^n-3+2=3(3^n-1)+2=3g(n)+2$$ your assumption $g(n)=n^3-1$ is wrong