We know that general term of expansion (a+b)n is,
Tr+1=nCran−rbr
For (1+x)n,
Tr+1=nCr1n−rxr
Tr+1=nCrxr …… (1)
Therefore,
Coefficient of (r+1)th term =nCr
Similarly,
Coefficient of (r)th term =nCr−1
Coefficient of (r−1)th term =nCr−2
According to the question,
nCr−2nCr−1=13
(r−1)(n−r+1)!(n−r+2)!=13
(r−1)(n−r+2)=13
3(r−1)=n−r+2
n−4r+5=0 …… (2)
Similarly, for rth and (r+1)th terms,
3n−8r+3=0 …… (3)
Solving equations (2) and (3), we get
r=3 and n=7
Hence, the values of n is 7 and r is 3.