similar to memorize, but halts its memorization after n-unique unmemorized calls are made to the function.