Given
(1+x2)2(1+x)n=∑n+4k=0akxk
⇒(1+2x2+x4)(1+nx+n(n−1)2!x2+n(n−1)(n−2)3!x3+....)=a0+a1x+a2x2+a3x3+....
Comparing coefficients of x,x2,x3...., we get
a1=n
a2=2+n(n−1)2!
⇒a2=n2−n+42
a3=2n+n(n−1)(n−2)3!
⇒a3=n3−3n2+14n6
Since, a1,a2,a3 are in A.P.
⇒2a2=a1+a3
⇒n2−n+4=n+n3−3n2+14n6
⇒n3−9n2+26n−24=0
⇒(n−2)(n−3)(n−4)=0
⇒n=2,3,4