proof by induction, memoization/dyn prog