problem 17 from problem set 5 1440848