The nth Triangular number, T(n) = 1 + … + n, is the sum of the first n integers. It is the number of points in a triangular array with n points on side. For example T(4):
X
X X
X X X
X X X X
X X
X X X
X X X X
Write a program to compute the weighted sum of triangular numbers:
W(n) = SUM[k = 1…n; k * T(k + 1)]