Solution of Project Euler #19