solves Euler2

Solves the second euler problem