Olympiad Algebra & Functional Equations

Study Sheet

Olympiad Algebra & Functional Equations

Inequalities at proof level, polynomials, functional equations

Proof-Level Algebra

Tip
The inequality ladder

AM–GM (with equality iff all equal: ab+bc+ca≥3\tfrac ab + \tfrac bc + \tfrac ca \ge 3), Cauchy–Schwarz and its Engel form ∑ai2bi≥(∑ai)2∑bi\sum\tfrac{a_i^2}{b_i} \ge \tfrac{(\sum a_i)^2}{\sum b_i}, rearrangement, Chebyshev, Jensen for convex functions, Schur, and the SOS (sum of squares) method. Always locate the equality case first; it tells you which inequality to apply and where to apply it.

Tip
Functional equations

Substitute strategically (x=y=0x = y = 0, y=−xy = -x, y=1y = 1), look for injectivity or surjectivity, and guess the form (f(x+y)=f(x)+f(y)+xyf(x + y) = f(x) + f(y) + xy suggests x22+cx\tfrac{x^2}{2} + cx). Cauchy's equation f(x+y)=f(x)+f(y)f(x+y) = f(x) + f(y) has only linear solutions under any regularity (monotone, bounded, continuous). Always verify the found function satisfies the original equation.

Tip
Polynomials at proof level

Integer polynomials: a−b∣P(a)−P(b)a - b \mid P(a) - P(b). Roots of unity filter and symmetric-function bookkeeping (r2+s2+t2=4r^2 + s^2 + t^2 = 4 for x3−2x+5x^3 - 2x + 5 without touching the roots). Irreducibility via Eisenstein or reduction mod pp. Degree and leading-coefficient comparison to pin down polynomial identities.

Integer Polynomials: a−b∣P(a)−P(b)a-b\mid P(a)-P(b)

Tip
The difference lemma

If PP has integer coefficients and a≠ba\ne b are integers, then a−b∣P(a)−P(b)a-b\mid P(a)-P(b). Consequences used constantly:

  • an integer root rr of PP satisfies r−k∣P(k)r-k\mid P(k) for every integer kk (take k=0k=0: r∣P(0)r\mid P(0));
  • P(k) mod mP(k)\bmod m depends only on k mod mk\bmod m;
  • along an orbit x0, x1=P(x0), x2=P(x1),…x_0,\ x_1=P(x_0),\ x_2=P(x_1),\dots each difference divides the next: xi+1−xi∣xi+2−xi+1x_{i+1}-x_i\mid x_{i+2}-x_{i+1}.

Write P(x)=∑ckxkP(x)=\sum c_kx^k. Then P(a)−P(b)=∑ck(ak−bk)P(a)-P(b)=\sum c_k(a^k-b^k), and each ak−bk=(a−b)(ak−1+ak−2b+⋯+bk−1)a^k-b^k=(a-b)(a^{k-1}+a^{k-2}b+\cdots+b^{k-1}) is a multiple of a−ba-b; with integer ckc_k so is the sum. The three consequences are the lemma with b=rb=r, with a≡b(modm)a\equiv b\pmod m, and with (a,b)=(xi+1,xi)(a,b)=(x_{i+1},x_i). Integer coefficients are essential, not integer values — the sidenote below shows the difference. The lemma turns a question about an unknown polynomial into divisibility among finitely many known numbers, which is why it opens most olympiad problems about P∈Z[x]P\in\mathbb Z[x].

Example
Worked: parity rules out integer roots

PP has integer coefficients, and P(0)P(0) and P(1)P(1) are both odd. Prove that PP has no integer root. (folklore)

Step 1 — every integer rr is congruent mod 22 to 00 or to 11; call that number ss.

Step 2 — by the lemma, r−sr-s divides P(r)−P(s)P(r)-P(s), and r−sr-s is even, so P(r)≡P(s)(mod2)P(r)\equiv P(s)\pmod2.

Step 3 — P(s)P(s) is P(0)P(0) or P(1)P(1), both odd, so P(r)P(r) is odd and in particular not 00.

How to find it. Information about PP at a complete set of residues mod mm controls PP at every integer. Two values, at 00 and 11, form a complete residue system mod 22.

Example
Worked: USAMO 1974 Problem 1

Let a,b,ca,b,c be three distinct integers. Prove there is no polynomial PP with integer coefficients such that P(a)=bP(a)=b, P(b)=cP(b)=c and P(c)=aP(c)=a. (USAMO 1974/1)

Step 1 — apply the lemma to the three pairs: a−b∣P(a)−P(b)=b−ca-b\mid P(a)-P(b)=b-c, then b−c∣c−ab-c\mid c-a, then c−a∣a−bc-a\mid a-b.

Step 2 — all three differences are nonzero, and a nonzero number divides another nonzero number only if it is not larger in absolute value, so ∣a−b∣≤∣b−c∣≤∣c−a∣≤∣a−b∣|a-b|\le|b-c|\le|c-a|\le|a-b|. All three absolute values equal some d>0d>0.

Step 3 — but (a−b)+(b−c)+(c−a)=0(a-b)+(b-c)+(c-a)=0, a sum of three terms each equal to +d+d or −d-d. Such a sum is an odd multiple of dd, never 00. Contradiction.

How to find it. A polynomial that permutes a few integers produces a closed loop of differences, each dividing the next. Going round the loop forces equal sizes, and the signs cannot then add to zero.

Example
Worked: IMO 2006 Problem 5

Let PP be a polynomial of degree n>1n>1 with integer coefficients, kk a positive integer, and Q=P∘P∘⋯∘PQ=P\circ P\circ\cdots\circ P (kk times). Prove that there are at most nn integers tt with Q(t)=tQ(t)=t. (IMO 2006/5)

Step 1 — reduce to k=2k=2. Let Q(t)=tQ(t)=t and follow the orbit x0=tx_0=t, xi+1=P(xi)x_{i+1}=P(x_i), which returns to x0x_0 after kk steps. Put di=xi+1−xid_i=x_{i+1}-x_i. By the lemma d0∣d1∣⋯∣dk−1∣dk=d0d_0\mid d_1\mid\cdots\mid d_{k-1}\mid d_k=d_0, so all ∣di∣|d_i| are equal, say to mm. If m=0m=0, tt is a fixed point of PP. If m>0m>0, the did_i are ±m\pm m and add up to 00 around the loop, so two consecutive ones have opposite signs: di+1=−did_{i+1}=-d_i, i.e. xi+2=xix_{i+2}=x_i. Then P(P(xi))=xiP(P(x_i))=x_i, and applying PP repeatedly shows every point of the orbit, tt included, satisfies P(P(x))=xP(P(x))=x.

Step 2 — so it suffices to count integer solutions of P(P(x))=xP(P(x))=x. If all of them are fixed points of PP, they are roots of P(x)−xP(x)-x, which has degree nn: at most nn of them.

Step 3 — otherwise pick aa with P(a)=b≠aP(a)=b\ne a and P(b)=aP(b)=a. Let rr be any integer solution and s=P(r)s=P(r), so P(s)=rP(s)=r. The lemma gives r−a∣s−br-a\mid s-b and s−b∣r−as-b\mid r-a, so r−a=±(s−b)r-a=\pm(s-b); likewise r−b=±(s−a)r-b=\pm(s-a). If both signs are ++, then r−s=a−br-s=a-b and r−s=b−ar-s=b-a, forcing a=ba=b. So one sign is −-, and either way r+s=a+br+s=a+b.

Step 4 — hence every integer solution is a root of P(x)+x−(a+b)P(x)+x-(a+b), a polynomial of degree nn (since n>1n>1), so there are at most nn of them.

How to find it. Iterating PP on integers is a walk along an orbit, and the difference lemma links consecutive steps. Divisibility round a closed loop forces equal step sizes — the same mechanism as in USAMO 1974/1 — and then the problem collapses to period 22, where the pair (a,b)(a,b) supplies a second polynomial of degree nn.

Side note
Where it goes wrong: integer values are not integer coefficients

Tempting: "PP takes integer values at every integer, so a−b∣P(a)−P(b)a-b\mid P(a)-P(b)." Counterexample: P(x)=x(x−1)2P(x)=\dfrac{x(x-1)}{2} is an integer at every integer, yet P(2)−P(0)=1P(2)-P(0)=1 is not divisible by 2−02-0.

The proof of the lemma used integer coefficients ckc_k; x(x−1)2\tfrac{x(x-1)}2 has coefficients 12\tfrac12 and −12-\tfrac12. Integer-valued polynomials are exactly the integer combinations of the binomial polynomials (xk)\binom xk, and for them only the weaker statement holds that k!k! times the leading coefficient is an integer. So when a problem says "P(n)P(n) is an integer for all integers nn", do not use a−b∣P(a)−P(b)a-b\mid P(a)-P(b); expand in the basis (xk)\binom xk or use finite differences instead.

Try it
Try it: four equal values

PP has integer coefficients and P(a)=P(b)=P(c)=P(d)=5P(a)=P(b)=P(c)=P(d)=5 for four distinct integers a,b,c,da,b,c,d. Prove that P(k)≠8P(k)\ne8 for every integer kk. (classic)

Show the answer

P(x)−5P(x)-5 has the four roots a,b,c,da,b,c,d, so P(x)−5=(x−a)(x−b)(x−c)(x−d)R(x)P(x)-5=(x-a)(x-b)(x-c)(x-d)R(x) with RR having integer coefficients (divide by the monic factors one at a time). If P(k)=8P(k)=8, then (k−a)(k−b)(k−c)(k−d)R(k)=3(k-a)(k-b)(k-c)(k-d)R(k)=3. The four numbers k−a,…,k−dk-a,\dots,k-d are distinct nonzero integers dividing 33, so they lie in {1,−1,3,−3}\{1,-1,3,-3\} and are exactly these four; their product is 99, which does not divide 33. Contradiction.

Roots of Unity: Filters and Factor Tests

Tip
The roots of unity filter

Let ω=e2πi/n\omega=e^{2\pi i/n}. Then

∑j=0n−1ωjk={n,n∣k,0,n∤k.\sum_{j=0}^{n-1}\omega^{jk}=\begin{cases}n,&n\mid k,\\0,&n\nmid k.\end{cases}

Hence for f(x)=∑akxkf(x)=\sum a_kx^k, the sum of the coefficients with n∣kn\mid k is 1n∑j=0n−1f(ωj)\dfrac1n\sum_{j=0}^{n-1}f(\omega^j). Also: a polynomial with real coefficients is divisible by x2+x+1x^2+x+1 exactly when it vanishes at ω=e2πi/3\omega=e^{2\pi i/3}.

If n∣kn\mid k every term is 11. Otherwise q=ωk≠1q=\omega^k\ne1 and the sum is the geometric series qn−1q−1=0\tfrac{q^n-1}{q-1}=0, because qn=(ωn)k=1q^n=(\omega^n)^k=1. Summing f(ωj)=∑kakωjkf(\omega^j)=\sum_ka_k\omega^{jk} over jj and swapping the order of summation keeps exactly nn copies of each aka_k with n∣kn\mid k and kills the rest. For the divisibility test: x2+x+1=(x−ω)(x−ωˉ)x^2+x+1=(x-\omega)(x-\bar\omega), and a real polynomial with P(ω)=0P(\omega)=0 also has P(ωˉ)=P(ω)‾=0P(\bar\omega)=\overline{P(\omega)}=0, so both linear factors divide it. The filter trades a sum over an arithmetic progression of indices for a handful of evaluations, which is how one counts objects whose size or sum lies in a residue class.

Example
Worked: every third binomial coefficient
60°1ωω²1 + ω1 + ω²
The parallelogram on 1 and ω has diagonal 1 + ω, of length 1 at angle 60°; so (1 + ω)¹² = 1.

Compute (120)+(123)+(126)+(129)+(1212)\dbinom{12}{0}+\dbinom{12}{3}+\dbinom{12}{6}+\dbinom{12}{9}+\dbinom{12}{12} without adding them up.

Step 1 — filter f(x)=(1+x)12f(x)=(1+x)^{12} with n=3n=3: the sum is 13(f(1)+f(ω)+f(ω2))\tfrac13\left(f(1)+f(\omega)+f(\omega^2)\right).

Step 2 — since 1+ω+ω2=01+\omega+\omega^2=0, 1+ω=−ω2=eiπ/31+\omega=-\omega^2=e^{i\pi/3}, a unit complex number at 60∘60^\circ (the figure). So (1+ω)12=e4πi=1(1+\omega)^{12}=e^{4\pi i}=1, and likewise (1+ω2)12=1(1+\omega^2)^{12}=1.

Step 3 — the sum is 212+1+13=40983=1366\tfrac{2^{12}+1+1}{3}=\tfrac{4098}{3}=1366. Check: 1+220+924+220+1=13661+220+924+220+1=1366.

How to find it. "Every third coefficient" is a residue class of indices — the filter's job. The key computation is always the polar form of 1+ωj1+\omega^j.

Example
Worked: when does x2+x+1x^2+x+1 divide x2n+xn+1x^{2n}+x^n+1?

Find all positive integers nn for which x2+x+1x^2+x+1 divides x2n+xn+1x^{2n}+x^n+1. (folklore)

Step 1 — by the test, it suffices to evaluate at ω=e2πi/3\omega=e^{2\pi i/3}, where ω3=1\omega^3=1, so ωn\omega^n depends only on n mod 3n\bmod3.

Step 2 — if 3∣n3\mid n: ω2n+ωn+1=1+1+1=3≠0\omega^{2n}+\omega^n+1=1+1+1=3\ne0, so no.

Step 3 — if 3∤n3\nmid n: ωn\omega^n is ω\omega or ω2\omega^2, and ω2n=(ωn)2\omega^{2n}=(\omega^n)^2 is the other one, so the value is ω+ω2+1=0\omega+\omega^2+1=0 — yes. The answer is all nn not divisible by 33.

How to find it. Divisibility by a product of cyclotomic factors is a question about the values at their roots, and xnx^n at a root of unity only sees nn modulo the order.

Example
Worked: subsets with sum divisible by 55

How many subsets of {1,2,…,2000}\{1,2,\dots,2000\} (including the empty set) have a sum divisible by 55? (classic; compare IMO 1995/6)

Step 1 — the generating function f(x)=∏k=12000(1+xk)f(x)=\prod_{k=1}^{2000}(1+x^k) has, as coefficient of xsx^s, the number of subsets with sum ss. The answer is the sum of the coefficients with 5∣s5\mid s, which the filter gives as 15∑j=04f(ωj)\tfrac15\sum_{j=0}^{4}f(\omega^j) with ω=e2πi/5\omega=e^{2\pi i/5}.

Step 2 — f(1)=22000f(1)=2^{2000}.

Step 3 — for j=1,…,4j=1,\dots,4, ωj\omega^j is a primitive fifth root, and as kk runs through 1,…,20001,\dots,2000 the powers ωjk\omega^{jk} run through all five fifth roots of unity 400400 times each, so f(ωj)=(∏r=04(1+ωr))400f(\omega^j)=\left(\prod_{r=0}^{4}(1+\omega^r)\right)^{400}.

Step 4 — from x5−1=∏r=04(x−ωr)x^5-1=\prod_{r=0}^4(x-\omega^r) at x=−1x=-1: −2=∏(−1−ωr)=−∏(1+ωr)-2=\prod(-1-\omega^r)=-\prod(1+\omega^r), so ∏r=04(1+ωr)=2\prod_{r=0}^4(1+\omega^r)=2 and f(ωj)=2400f(\omega^j)=2^{400}.

Step 5 — the count is

22000+4⋅24005.\frac{2^{2000}+4\cdot2^{400}}{5}.

How to find it. "Sum divisible by 55" is a residue class of exponents in a product generating function. Evaluating the product at roots of unity needs one identity, ∏(x−ωr)=x5−1\prod(x-\omega^r)=x^5-1, evaluated at a convenient point.

Side note
Where it goes wrong: one root is not enough

Tempting: "x4+x2+1x^4+x^2+1 is divisible by x2+x+1x^2+x+1 (the case n=2n=2 above), so to test divisibility by x4+x2+1x^4+x^2+1 it is enough to check P(ω)=0P(\omega)=0." Counterexample: P(x)=x2+x+1P(x)=x^2+x+1 vanishes at ω\omega but is not divisible by x4+x2+1x^4+x^2+1.

The failing step is treating x4+x2+1x^4+x^2+1 as if its roots were only ω\omega and ωˉ\bar\omega. In fact x4+x2+1=(x2+x+1)(x2−x+1)x^4+x^2+1=(x^2+x+1)(x^2-x+1), and the second factor has the primitive sixth roots e±iπ/3e^{\pm i\pi/3} as roots. A polynomial is divisible by DD exactly when it vanishes at every root of DD (with multiplicity), so factor DD into cyclotomic pieces and test one root of each piece.

Try it
Try it: every fourth coefficient

Compute (90)+(94)+(98)\dbinom90+\dbinom94+\dbinom98 with the roots of unity filter.

Show the answer

Filter (1+x)9(1+x)^9 with the fourth roots of unity 1,i,−1,−i1,i,-1,-i: the sum is 14(29+(1+i)9+09+(1−i)9)\tfrac14\left(2^9+(1+i)^9+0^9+(1-i)^9\right). Since (1+i)2=2i(1+i)^2=2i, (1+i)8=(2i)4=16(1+i)^8=(2i)^4=16 and (1+i)9=16+16i(1+i)^9=16+16i; similarly (1−i)9=16−16i(1-i)^9=16-16i. The sum is 512+324=136\tfrac{512+32}{4}=136. Check: 1+126+9=1361+126+9=136.