Hi, I'm assuming that I am calculating for k <= n.

A quick check with python gives the following results:

Code:

>>> def iterate(n):
c = 0
for k in range(1, n + 1):
for j in range(1, k + 1):
for i in range(1, j + 1):
c = c + 1
print c
>>> iterate(1)
1
>>> iterate(2)
4
>>> iterate(3)
10
>>> iterate(4)
20
>>> iterate(5)
35
>>> iterate(6)
56

and here's Pascal's triangle:

Code:

1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1

If the row and column's are 0-based, look at the n+2 row and the n-1 column and you get the number of iterations.

So if n = 1, look at row 3, column 0: 1

n = 2, look at row 4, column 1: 4

n = 3, row 5, column 2: 10

etc.

I determined this to be (n+2) choose (n-1).

However, I don't think this is a *mathematical* enough answer.