
Let a is the first term and d is the common difference of the AP
So sum of p terms Sp = (p/2){2a + (p-1)d}
Sum of q terms Sq = (q/2){2a + (q-1)d}
Now since sum of p terms is q and sum of q terms is p,then
Sp = Sq
=> (p/2){2a + (p-1)d} = (q/2){2a + (q-1)d}
=> p{2a + (p-1)d} = q{2a + (q-1)d}
=> 2ap + p2 d - pd = 2aq + q2 d - qd
=> 2ap + p2 d - pd - 2aq - q2 d + qd = 0
=> 2a(p-q) + d(p2 - d2 ) - d(p-q) = 0
=>(p-q)*{2a + d(p+q) - d} = 0
=> (p-q)*{2a + d(p+q-1)} = 0
Now p-q = 0 ...1
and {2a + d(p+q-1)} = 0 ........2
Multiply (p+q)/2 in eqaution 2, we get
{(p+q)/2}*{2a + d(p+q-1)} = 0
=> Sp+q = 0
So sum of p+q terms is 0.