Solution of Project Euler #10