### Theory:

The natural numbers are $$1$$, $$2$$, $$3$$, $$4$$, …

We need to find the value of $$1 + 2 + 3 + 4 + …. + n$$.

Consider the identity $$(x + 1)^{k + 1} - x^{k + 1}$$.

Since the power of all the numbers is $$1$$, put $$k = 1$$ in the above identity.

$$(x + 1)^{1 + 1} - x^{1 + 1} = (x + 1)^2 - x^2$$

$$= x^2 + 2x + 1 - x^2$$

$$= 2x + 1$$

$$(x + 1)^2 - x^2 = 2x + 1$$ - - - - (I)

Now, substitute $$x = 1, 2, 3, … n$$ in equation (I).

When $$x = 1$$, $$2^2 - 1^2 = 2(1) + 1$$

When $$x = 2$$, $$3^2 - 2^2 = 2(2) + 1$$

When $$x = 3$$, $$4^2 - 3^2 = 2(3) + 1$$

$$\vdots$$             $$\vdots$$             $$\vdots$$

When $$x = n - 1$$, $$n^2 - (n - 1)^2 = 2(n - 1) + 1$$

When $$x = n$$, $$(n + 1)^2 - n^2 = 2(n) + 1$$

Add all the above equations of $$x$$ values.

$$2^2 - 1^2 + 3^2 - 2^2 + 4^2 - 3^2 + \cdots + n^2 - (n - 1)^2 + (n + 1)^2 - n^2 = 2(1) + 1 + 2(2) + 1 + 2(3) + 1 + \cdots + 2(n - 1) + 1 + 2(n) + 1$$

$$2^2 + 3^2 + 4^2 + \cdots + n^2 + (n + 1)^2 - (1^2 + 2^2 + 3^2 + \cdots + (n - 1)^2 + n^2) = 2(1) + 2(2) + 2(3) + \cdots + 2(n - 1) + 2(n) + (1 + 1 + 1 + ... n \ times )$$

Cancelling the same terms with opposite signs on LHS, we get:

$$(n + 1)^2 - 1^2 = 2(1 + 2 + 3 + … + (n - 1) + n) + n$$

$$n^2 + 2n + 1^2 - 1^2 = 2(1 + 2 + 3 + … + (n - 1) + n) + n$$

$$n^2 + 2n = 2(1 + 2 + 3 + … + (n - 1) + n) + n$$

$$n^2 + 2n - n = 2(1 + 2 + 3 + … + (n - 1) + n)$$

$$n^2 + n = 2(1 + 2 + 3 + … + (n - 1) + n)$$

$\frac{{n}^{2}+n}{2}=1+2+3+...+\left(n-1\right)+n$

Therefore, $1+2+3+...+\left(n-1\right)+n=\frac{n\left(n+1\right)}{2}$.
Sum of first $$n$$ natural numbers $$=$$ $\frac{n\left(n+1\right)}{2}$
Important!
1. The sum of first $$n$$ natural numbers are also called Triangular Numbers because they form triangle shapes.

2. The sum of squares of first $$n$$ natural numbers are also called Square Pyramidal Numbers because they form pyramid shapes with square base.