did problem 22 of Euler