How to show that $$ \binom {n+1} 3 + \binom {n+2} 3 = \sum_{i=1}^{n} i^2$$ by a combinatorial proof?
It's not difficult to check this algebraically and show that the left hand side is $\frac{n(n+1)(n-1)+n(n+1)(n+2)}{6} = \frac{n(n+1)(2n+1)}{6} = \sum_{i=1}^n i^2$. However, I fail to see how this is true by a combinatorial argument. In particular, I can visualise the right-hand side as a pile of cubes with each layer having $i^2$ cubes. However, I am not able to relate it to the left hand side. Any help will be appreciated!