euler problem 14, with recursion