Solved the first euler problem