Project Euler problem #7