Refactored project euler problems 1,2,3.