Solution of Project Euler #9