I once tried to find how to quickly find the total number of squares in a bigger, $n\times n$ grid. I’m sure you’ve seen one of these puzzles, and the bigger the grid, the more embedded squares there are and the more chance you have of miscounting. So I finally came up with the answer
$$ \sum^n\_{k=1}k^2$$ which can be simplified to $$\frac{n(n+1)(2n+1)}{6}$$ Then later on, I wanted to try the same with a triangular (equilateral) grid, where the size $n$ corresponds to the side of the triangle.

[![A bit like this](https://i.stack.imgur.com/Y375X.png)](https://i.stack.imgur.com/Y375X.png)

So I eventually found a formula that has two summation terms, one inside the other, with some even/odd evaluator ($n$ is the size of a side): $$T(n)=\sum^n\_{k=1}\bigg(\frac{3-(-1)^{n-k}}{2}\sum^k\_{j=1}j\bigg)$$
The fraction in between the two sums is the even/odd evaluator, and determines if $n-k$ is even or odd. Now this looks long and tedious, and for large grid sizes, only a computer could do it without a chance of mistaking. Now for the important part, my question is this: Is there a way to simplify the formula in a similar way than the square grid one? Yes, I did try Wolfram Alpha, and it just gave me back the summation form of the formula.