Completed euler problem 2.