Prime Finder - Function Memoization