Small improvements to Euler problem #4