# Find the sum of the odd numbers between 0 and 50.

#### Complete Python Prime Pack

9 Courses     2 eBooks

#### Artificial Intelligence & Machine Learning Prime Pack

6 Courses     1 eBooks

#### Java Prime Pack

9 Courses     2 eBooks

Given:

Odd numbers between 0 and 50.

To do:

We have to find the sum of the odd numbers between 0 and 50.

Solution:

Odd numbers between 0 and 50 are $1,3,5,7, \ldots, 49$.

The sequence is in A.P.

Here,

$a=1$ and $d=3-1=2$

$l=49$

We know that,

$l=a+(n-1) d$

$49=1+(n-1) \times 2$

$49=1+2 n-2$

$49+1=2 n$

$n=\frac{50}{2}=25$

Therefore,

$n=25$

We know that,

$\mathrm{S}_{n}=\frac{n}{2}[2 a+(n-1) d]$

$=\frac{25}{2}[2 \times 1+(25-1)\times 2]$

$=\frac{25}{2}[2+24 \times 2]$

$=\frac{25}{2}(50)$

$=25 \times 25$

$=625$

The sum of all odd numbers between 0 and 50 is $625$.

Updated on 10-Oct-2022 13:20:30