Question 1173561
.
<pre>

The number of balls in the k-th layer from the top is  {{{(k*(k+1))/2}}}, k = 1, 2, 3, . . . , n.


The number of balls in the entire triangle pyramid of n layers is  {{{(n*(n+1)*(n+2))/6}}}.    <U>ANSWER</U>


This formula can be easily proved by the method of Mathematical induction.
</pre>


For more details, see this link


https://math.stackexchange.com/questions/1148720/finding-the-formula-for-the-number-of-golf-balls-in-a-triangular-pyramid-with-n



/\/\/\/\/\/\/



Be aware (!)



1) &nbsp;&nbsp;The formula in the post by @Boreal is INCORRECT (!)



2) &nbsp;&nbsp;The formula in the post by &nbsp;@ewatrrr &nbsp;&nbsp;&nbsp;&nbsp;{{{sum((N[i](N[i]-1)/2), i=1, N))}}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is incorrect, &nbsp;too &nbsp;(!)



&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The correct writing is &nbsp;THIS &nbsp;&nbsp;&nbsp;&nbsp;{{{sum( (i(i+1)/2), i=1, N))}}},


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and it gives that final compact formula as presented in my post.



. . . . . . . . 


@ewatrrr fixed her post after seeing my solution.