# What is the sum of all odd numbers between 0 and 100?

Sep 17, 2015

First, notice an interesting pattern here:

$1 , 4 , 9 , 16 , 25 , \ldots$

The differences between perfect squares (starting at $1 - 0 = 1$) is:

$1 , 3 , 5 , 7 , 9 , \ldots$

The sum of $1 + 3 + 5 + 7 + 9$ is $25$, the ${5}^{\text{th}}$ nonzero square.

Let's take another example. You can quickly prove that:

$1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 17 + 19 = 100$

There are $\frac{19 + 1}{2} = 10$ odd numbers here, and the sum is ${10}^{2}$.

Therefore, the sum of $1 + 3 + 5 + \ldots + 99$ is simply:

${\left(\frac{99 + 1}{2}\right)}^{2} = \textcolor{b l u e}{2500}$

Formally, you can write this as:

$\textcolor{g r e e n}{{\sum}_{n = 1}^{N} \left(2 n - 1\right) = 1 + 3 + 5 + \ldots + \left(2 N - 1\right) = {\left(\frac{N + 1}{2}\right)}^{2}}$

where $N$ is the last number in the sequence and $n$ is the index of each number in the sequence. So, the ${50}^{\text{th}}$ number in the sequence is $2 \cdot 50 - 1 = 99$, and the sum all the way up to that is ${\left(\frac{99 + 1}{2}\right)}^{2} = 2500$.