HPR Interview Question

Memoization problem with prime numbers in C