Find the number of odd coefficients in terms of $n$, in the expansion of $(x^2+x+1)^n$ where $n$ is a positive integer.
I have tried directly applying multinomial and condition for it to be odd by using base 2 but failed to find number of solutions to the equations.
$(x^2+x+1)^n=\sum_{k=0}^{n}C^k_n(x^2+x)^k$ and count when $C^k_n$ is odd and the same for $(x^2+x)^k$ and it is odd when the first coefficient and the second coef are odds
All the $C^k_n$ are odds if and only if $n=2^p–1$
All the $C^k_n$ are even if and only if $n=2^p$