The number of odd coefficients in the expansion of $(x^2+x+1)^n$

843 Views Asked by At

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.

2

There are 2 best solutions below

0
On

$(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$

0
On

The first thing to do on a problem like this, especially if you don't know how to get a purchase on it, is to systematically compute a bunch of small examples and look for a pattern. In this case, the number of odd coefficients for $(x^2+x+1)^n$, starting with $n=1$, is

$$3,3,5,3,9,5,11,\ldots$$

(There are various tricks for simplifying these computations, which I won't into here, except to say that working mod $2$ is a good idea.)

If you don't see an obvious pattern -- which I don't -- the next thing to do is see what the OEIS has to say. In this case you get sequence A071053. Sometimes the OEIS tells you exactly what you need to know; other times it points you in a helpful direction; and sometimes what you find there suggests that the question you're asking is a hard one to solve. It looks to me like this we're in the third case here.