Code for problem 40.
Code for problem 130.
Code for problem 38.