Solution to Problem 5, 'Smallest multiple'