solution to project euler #6