

Let a is first term and d is the common difference of the Ap
Now given mth term = n
=> a + (m-1)d = n
=> a = n - (m-1)d ............1
Again given nth term = m
=> a + (n-1)d = m
=> a = m - (n-1)d ............2
From eqaution 1 and 2, we get
m - (n-1)d = n - (m-1)d
=> m - nd -d = n - md - d
=> m - n = -md - d + nd + d
=> m - n = (n-m)d
=> d = (m-n)/(n-m)
=> d = -(m-n)/(m-n)
=> d = -1
from eqaution 2, we get
a = m - (n-1)*(-1)
=> a = m + (n-1)
=> a = m + n -1
Now, pth term = a + (p-1)d
= (m + n -1) + (p-1)*(-1)
= m + n -1 - (p-1)
= m + n -1 - p + 1
= m + n - p
So, pth term = m + n - p
