Prove that $\forall n \in N $ , $ \sum_{i=1}^n i = \frac{n(n+1)}{2}$, counting in two ways the number of shaded squares in the diagram Prove that $\forall n \in  N $  $$ \sum_{i=1}^n i = \frac{n(n+1)}{2}$$ counting in two ways  the number of shaded squares in the diagram.

I have been thinking about this, but I can't understand how prove it counting the shaded squares. Can i assume that $ 1+2+3+...+n $ is the number of shaded squares?
I can't see it clearly.
The left-hand side sums over the numbers of shaded squares per row. The right-hand side is the number of shaded squares in an $n\times(n+1)$ rectangle; exactly half are shaded, by an order-$2$ rotational symmetry.
Here's an idea for you, which seems to explain the famous legend about how Gauss came up with a solution at his school:
Call the sum of all shaded squares $\;S\;$ , and we now count them in two ways:
(*) Number of shaded squares by row, from to to bottom:
$$\;S= 1 +2 +3+\ldots+n\;\;(*)$$
(**) And now let's count the number of shaded squares per column from left to right:
$$S=n+(n-1)+(n-2)+\ldots+2+1 \;\;(**)$$
Now put both sums above one over the other and sum them up column after column:
$$\begin{cases}S=1&amp;+&amp;2&amp;+&amp;3&amp;+\ldots+&amp;(n-1)&amp;+&amp;n\\{}\\
S=n&amp;+&amp;(n-1)&amp;+&amp;(n-2)&amp;+\ldots+&amp;2&amp;+&amp;1\\{}\\
--&amp;--&amp;--&amp;--&amp;--&amp;--&amp;--&amp;--&amp;--&amp;--&amp;--\\{}\\
2S=(n+1)&amp;+&amp;(n+1)&amp;+&amp;(n+1)&amp;\ldots&amp;(n+1)&amp;+&amp;(n+1)\end{cases}$$
You got, in fact, $\;2S=n(n+1)\;$ ...and now divide by two and we're done.