solution for project euler problem 17