Begins solving Problem 44 in Python