If S = cos2πn+cos22πn+........+cos2(n−1)πn then S is equal to
n/2
S = 12[1+cos2πn+1+cos4πn+1+cos6πn+...+.....+1+cos2(n−1)πn]
= 12[(n−1)+∑n−1λ=1cos2kπn]
= 12[n−1−1]=12(n−2)