(1+x2)2=1+2x2+x4. Multiply with (1+x)n:
Coefficient of x: n.
Coefficient of x2: (2n)+2=2n(n−1)+2.
Coefficient of x3: (3n)+2n=6n(n−1)(n−2)+2n.
For AP: 2(2n(n−1)+2)=n+6n(n−1)(n−2)+2n.
Simplifying: n3−9n2+26n−24=0.
(n−2)(n−3)(n−4)=0⇒n=2,3,4.
Sum =2+3+4=9.