Find the amount of debt after n months

From the book "Mathematics and physics for programmers" by Danny Kodicek and John P. Flynt (see Google Books)