added test and method to determine nth triangular number