Example 5 If the sum of n terms of an A.P. is nP + 1/2 n (n – 1) Q