Problem 14. Using dictionaries to store previously calculated values