fixed bug with memoization function
added solution to project euler 14