Add CachedFactorial class for problem 34