# The first term of an AP is $-5$ and the last term is 45 . If the sum of the terms of the AP is 120 , then find the number of terms and the common difference.

#### 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:

The first term of an A.P. is $-5$, the last term is 45 and the sum is 120.

To do:

We have to find the number of terms and the common difference of the A.P.

Solution:

Let the number of terms of the given A.P. be $n$, first term be $a$ and the common differnce be $d$.

First term $a=-5$

Last term $l= 45$

Sum of all the terms $S_{n} =120$

We know that,

Sum of the $n$ terms$S_{n} =\frac{n}{2}( a+l)$

$\Rightarrow 120=\frac{n}{2}( -5+45)$

$\Rightarrow 120=n(20)$

$\Rightarrow n=\frac{120}{20} =6$

Also,

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

Therefore,

On subtituting the values of $a$, $l$ and $n$, we get,

$45=-5+( 6-1) d$

$\Rightarrow 5d=45+5=50$

$\Rightarrow d=\frac{50}{5}$

$=10$

Hence, the number of terms is $6$ and the common difference of the given A.P. is $10$.

Updated on 10-Oct-2022 13:27:34