Apply memoization to Euler 76