solve s(n+1) = 2s(n)+2d, s(1) = a