#### Question

The first term of an AP is 5, the last term is 45 and the sum is 400. Find the number of terms and the common difference.

#### Solution 1

In the given problem, we have the first and the last term of an A.P. along with the sum of all the terms of A.P. Here, we need to find the number of terms and the common difference of the A.P.

Here,

The first term of the A.P (*a*) = 5

The last term of the A.P (*l*) = 45

Sum of all the terms `S_n = 400`

Let the common difference of the A.P. be *d*.

So, let us first find the number of the terms (*n*) using the formula,

`400= (n/2) (5 + 45)`

`400 = (n/2)(50)`

400 = (n)(25)

`n = 400/25`

n = 16

Now, to find the common difference of the A.P. we use the following formula,

l = a + (n -1)d

We get

45 = 5 + (16 - 1)d

45 = 5 + (15)d

45 = 5 = 15d

`(45 - 5)/15 = d`

Further, solving for d

`d = 40/15`

`d = 8/3`

Therfore the number of terms is n = 16 and the common difference of the A.p is `d = 8/3`

#### Solution 2

Here, a_{1} = 5, a_{n} = 45 and S_{n} = 400

Find: n, d

a_{n}= a + (n − 1)d = 45

⇒5 + (n − 1)d = 45

⇒(n − 1)d = 40 .....(1)

Now,

`S_n = n/2 [2a + (n -1)d] = 400`

`=>[10 + (n - 1)d] = 800/n` {As a = 5}

`[10 + 40] = 800/n` {By equation 1}

`=> n = 800/50`

`=> n = 16`

Put *n *= 16 in the equation (1).

`=>(16 - 1)d = 40`

`=> d = 40/15`

`=> d = 8/3`

Hence, the common difference of an A.P is `8/3` and number of terms is 16.