Add a method for getting the nth triangular number for Problem 12.