More memory efficient solution to problem 1. No reason to maintain list of multiples