We know that coefficients of (r-1)th, r th and (r+1) th terms in the expansion of (x+1)n are nCr−2, nCr−1 and nCr respectively.
Now nCr−2:nCr−1:nCr=1:3:5(Given)
⇒nCrnCr−1=53 and nCr−1nCr−2=31
⇒n−r+1r=53 and n−r+2r−1=31 [∵nCrnCr−1=n−r+1r]
⇒3n−8r+3=0 and n−4r+5=0
Solving these for n and r, we get
n=7 and r=3.