g(n)= g(n-1) + 2^(g(n-1)) and g(0) = 0