Problem 6 of chapter 16 in Gaddis