Add solution for project euler problem 3