Consider the following recurrences allowing function $g_2:\mathbb N\to \mathbb N.$ $g_2(n)=\begin{cases} n+1 &\;\text{if $n=0$ or $n=1$}\\ n+1+\sum_{i=1}^{n-1} (i.g_2(n-1-i)) &\;\text{if $n>1$} \end{cases}$
$g_2(n) = 2^n$ for all $n\in\mathbb N$ is what I want to prove. Here's the original image.
My attempt:
Prove $g_2(n) = 2^n, \forall n \in \mathbb N$
Base cases:
let n = 0
$g_2(0) = 0 + 1 = 1 = 2^0 = 2^n$ [def of both functions] as wanted
let n = 1
$g_2(1) = 1 + 1 = 2 = 2^1 = 2^n$ [def of both functions] as wanted
Inductive step: let $n > 1$
Suppose $g_2(j) = 2^j$ whenever $0 \leq j < n$ [I.H]
WTP: $g_2(n) = 2^n$
$g_2(n) = n + 1 + \sum_{i=1}^{n-1} (i \cdot g_2(n-1-i))$ [def of $g_2(n); n > 1$]
= $n + 1 + \sum_{i=1}^{n-1} i \cdot 2^{n-1-i}$ [I.H]
= $n + 1 + \sum_{i=0}^{n-1} i \cdot 2^{n-1-i}$ [Since $i=0$ is just $0$ so same thing?]
Confused on the above step. Could someone help?