Problem 1 using Python and a list/range strategy. Could probably be more
efficient, but given the size of the problem, this works fine.