it is not possible for all A.P's
but for this question here is the idea
(1+x)n=1+c1x+c2x2+..............
replace x by i i.e

-1
write (i+i) as

2 cis

/4
on write hand side u get R+i(c1-c3+c5-c7....................
here R being the real part
but c1+c3+c5+............=2n-1 ....................(1)
let c1-c3+c5-c7....................=k .......................(2)
adding 1&2
c1+c5+c9+.............=(k+2n-1)/2
hence k=2(c1+c5+..........) -- 2n-1 ..........................(3)
R+i(c1-c3+c5.........)=R+i(k)
on right left hand side 2
n/2 * (cos n

/4+isinn

/4)=R+i(k)
hence we get the required sum