Maths Olympiad Prep

Library / /5 of 136

Number theory Difficulty 7.1 National Olympiad, round 2 Prove it Hong Kong

How many odd coefficients are there in the expansion of (x2x+1)2009(x^2 - x + 1)^{2009}?

Solution

In the following, we consider polynomials in F2[x]\mathbb{F}_2[x]. This means all coefficients are taken modulo 22. Let f(n)f(n) be the number of odd coefficients in (x2x+1)n(x^2 - x + 1)^n.

Claim 1. We have (x2x+1)2k=x2k+1x2k+1(x^2 - x + 1)^{2k} = x^{2k+1} - x^{2k} + 1 for any nonnegative integer kk.
Proof. It suffices to note that
(x2x+1)2=x42x3+3x22x+1=x4x2+1. (x^2 - x + 1)^2 = x^4 - 2x^3 + 3x^2 - 2x + 1 = x^4 - x^2 + 1.
The result follows easily by induction. \square

Claim 2. We have f(2ka+b)=f(a)f(b)f(2ka+b) = f(a)f(b) for any positive integers a,ba, b satisfying b<2k1b < 2^{k-1}.
Proof. By claim 1, we have
(x2x+1)2ka+b=((x2x+1)2k)a(x2x+1)b=(x2k+1x2k+1)a(x2x+1)b. (x^2 - x + 1)^{2ka+b} = ((x^2 - x + 1)^{2k})^a (x^2 - x + 1)^b = (x^{2k+1} - x^{2k} + 1)^a (x^2 - x + 1)^b.
(x2k+1x2k+1)a=i=1scix2kαi, (x^{2k+1} - x^{2k} + 1)^a = \sum_{i=1}^{s} c_i x^{2k \alpha_i},
(x2x+1)b=j=1tdjxβj. (x^2 - x + 1)^b = \sum_{j=1}^{t} d_j x^{\beta_j}.
Then their product is
i=1sj=1tcidjx2kαi+βj. \sum_{i=1}^{s} \sum_{j=1}^{t} c_i d_j x^{2k\alpha_i + \beta_j}.
Since we have βj2b<2k\beta_j \le 2b < 2^k, different pairs (i,j)(i, j) correspond to different exponents 2kαi+βj2^k\alpha_i + \beta_j. Also, cidjc_i d_j is odd if and only if both cic_i and djd_j are odd. As there are f(a)f(a) odd coefficients cic_i and f(b)f(b) odd coefficients djd_j, the number of odd coefficients is f(a)f(b)f(a)f(b). \square

Claim 3. We have f(2k1)=2k+2(1)k3f(2^k - 1) = \frac{2^{k+2} - (-1)^k}{3} for any positive integer kk.
Proof. It suffices to make the following observations. For odd kk, the coefficients of (x2x+1)2k1(x^2 - x + 1)^{2^k-1} follow the pattern
1101101102k23 triples 1101110110110112k23 triples 011 \underbrace{110110\cdots110}_{\frac{2^{k-2}}{3} \text{ triples } 110} 111 \underbrace{011011\cdots011}_{\frac{2^{k-2}}{3} \text{ triples } 011}
while for even kk, the coefficients of (x2x+1)2k1(x^2 - x + 1)^{2^k-1} follow the pattern
1101101102k13 triples 11010110110112k13 triples 011. \underbrace{110110\cdots110}_{\frac{2^{k-1}}{3} \text{ triples } 110} 1 \underbrace{011011\cdots011}_{\frac{2^{k-1}}{3} \text{ triples } 011}.
It is not hard to prove these by induction and claim 1, since 2k+11=(2k1)2k2^{k+1}-1 = (2^k-1)2^k. We omit the details. \square

Now, by the above claims, we obtain
f(2009)=f(26×31+25)=f(31)f(25)=f(31)f(23×3+1)=f(31)f(3)f(1)=27+13241323+13=645. \begin{aligned} f(2009) &= f(2^6 \times 31 + 25) = f(31)f(25) \\ &= f(31)f(2^3 \times 3 + 1) = f(31)f(3)f(1) \\ &= \frac{2^7 + 1}{3} \cdot \frac{2^4 - 1}{3} \cdot \frac{2^3 + 1}{3} = 645. \end{aligned}

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.