The solution depends on what n is congruent to, when taken modulo 3.
Suppose n is congruent to 0 modulo 3, then consider
1+w+w^2+w^3+w^4+w^5+w^6+w^7+w^8+...+w^n
Since w is a root of unity, we have w^3=1 and thus trivially 1+w+w^2=0.
So factorising the above expression, we acquire...