complete Project Euler #8