Maths Olympiad Prep

Library / /3 of 11

Number theory Difficulty 5.4 AIME, harder Prove it Spain

Let pp be a prime number and let mm and nn be positive integers written in base pp as n=a0+a1p++akpkn = a_0 + a_1p + \dots + a_kp^k and m=b0+b1p++bkpkm = b_0 + b_1p + \dots + b_kp^k, respectively. Show that
(nm)i=0k(aibi)(modp) \binom{n}{m} \equiv \prod_{i=0}^{k} \binom{a_i}{b_i} \pmod{p}

Solution

Since (nm)=0\binom{n}{m} = 0 for n<mn < m then hereafter we assume that nmn \ge m. Next we use the well-known and easily proved fact that (x+1)pxp+1(modp)(x+1)^p \equiv x^p + 1 \pmod{p}, meaning that each coefficient of the polynomial (x+1)p(xp+1)(x+1)^p - (x^p + 1) is divisible by pp. Thus,
(x+1)n=(x+1)a0+a1p++akpki=0k(xpi+1)ai(modp)i=0k(j=0ai(aij)xjpi)(modp) \begin{align*} (x+1)^n &= (x+1)^{a_0+a_1p+\cdots+a_kp^k} \equiv \prod_{i=0}^k (x^{p^i}+1)^{a_i} \pmod{p} \\ &\equiv \prod_{i=0}^k \left( \sum_{j=0}^{a_i} \binom{a_i}{j} x^{jp^i} \right) \pmod{p} \end{align*}
The coefficient of xmx^m in the LHS is
(x+1)n[xm]=(nm) (x+1)^n [x^m] = \binom{n}{m}
and the coefficient of xmx^m in the RHS is the coefficient of the following monomial
(a0b0)xb0(a1b1)xb1p(akbk)xbkpk=xb0+b1p++bkpki=0k(aibi) \binom{a_0}{b_0} x^{b_0} \binom{a_1}{b_1} x^{b_1 p} \cdots \binom{a_k}{b_k} x^{b_k p^k} = x^{b_0+b_1p+\cdots+b_kp^k} \prod_{i=0}^{k} \binom{a_i}{b_i}
Equating both coefficients, yields
(nm)i=0k(aibi)(modp) \binom{n}{m} \equiv \prod_{i=0}^{k} \binom{a_i}{b_i} \pmod{p}

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.