Changed euler3 solution to use nested function.