#### Question

In an A.P., if the first term is 22, the common difference is −4 and the sum to n terms is 64, find n.

#### Solution

In the given problem, we need to find the number of terms of an A.P. Let us take the number of terms as *n*.

Here, we are given that,

a = 22

d = -4

S_n= 6

So, as we know the formula for the sum of *n* terms of an A.P. is given by,

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

Where; *a* = first term for the given A.P.

*d* = common difference of the given A.P.

*n *= number of terms

So, using the formula we get,

`S_n= n/2 [2(22) + (n - 1)(-4)]`

`64 = n/2[44 - 4n + 4]`

64(2) = n(48 - 4n)

`128 = 48n - 4n^2`

Further rearranging the terms, we get a quadratic equation,

`4n^2 - 48n + 128 = 0`

On taking 4 common we get

`n^2 - 12n + 32 = 0`

Further, on solving the equation for *n* by splitting the middle term, we get,

`n^2 - 12n + 32 = 0`

`n^2 - 8n -4n + 32 = 0`

n(n - 8) - 4(n - 8) = 0

(n - 8)(n - 4) = 0

So, we get,

(n - 8) = 0

n = 8

Also

(n - 4) = 0

n = 4

Therefore n = 4 or 8