Maths Olympiad Prep

Library / /125 of 133

, 2015

Number theory Difficulty 7.1 National olympiad, round 2 Prove it Saudi Arabia

For each positive integer nn, define s(n)=k=0nrks(n) = \sum_{k=0}^{n} r_{k}, where rkr_{k} is the remainder when (nk)\binom{n}{k} is divided by 33. Find all positive integers nn such that s(n)ns(n) \geq n.

Solution

Let 0kn0 \leq k \leq n be two integers written in base 33 as
n=(3)nmnm1n1n0,k=(3)kmkm1k1k0 n = ^{(3)} \overline{n_{m} n_{m-1} \cdots n_{1} n_{0}}, \quad k = ^{(3)} \overline{k_{m} k_{m-1} \cdots k_{1} k_{0}}
such that nm0n_{m} \neq 0. We know from Lucas's theorem that
rk(nk)i=0m(niki)(mod3) r_{k} \equiv \binom{n}{k} \equiv \prod_{i=0}^{m} \binom{n_{i}}{k_{i}} \quad (\bmod 3)
If there exists 0im0 \leq i \leq m such that ki>nik_{i} > n_{i} then (niki)=0\binom{n_{i}}{k_{i}} = 0 and therefore rk=0r_{k} = 0. Therefore, from now on we will restrict to 0kn0 \leq k \leq n with kinik_{i} \leq n_{i} for all 0im0 \leq i \leq m.
Let 0im0 \leq i \leq m. If ni=0n_{i} = 0 then ki=0k_{i} = 0. If ni=1n_{i} = 1 then ki{0,1}k_{i} \in \{0, 1\}. In all these cases (niki)=1\binom{n_{i}}{k_{i}} = 1. If ni=2n_{i} = 2 then ki{0,1,2}k_{i} \in \{0, 1, 2\} and (niki)=1\binom{n_{i}}{k_{i}} = 1 if ki1k_{i} \neq 1 and (niki)=2\binom{n_{i}}{k_{i}} = 2 if ki=1k_{i} = 1. Therefore, if the number aa of pairs (ni,ki)=(2,1)(n_{i}, k_{i}) = (2, 1), when 0im0 \leq i \leq m, is odd then (nk)2a2(mod3)\binom{n}{k} \equiv 2^{a} \equiv 2 \pmod{3}, otherwise (nk)1(mod3)\binom{n}{k} \equiv 1 \pmod{3}. We deduce that
s(n)=2A(n)+B(n), s(n) = 2A(n) + B(n),
where A(n)A(n) is the number of pairs of integers (n,k)(n, k) such that 0kini0 \leq k_{i} \leq n_{i} for all 0im0 \leq i \leq m and the number of pairs (ni,ki)=(2,1)(n_{i}, k_{i}) = (2, 1), when 0im0 \leq i \leq m, is odd, while B(n)B(n) is the number of pairs of integers (n,k)(n, k) such that 0kini0 \leq k_{i} \leq n_{i} for all 0im0 \leq i \leq m and the number of pairs (ni,ki)=(2,1)(n_{i}, k_{i}) = (2, 1), when 0im0 \leq i \leq m, is even.
Denote by rr the number of 00's in n0,n1,n2,,nmn_{0}, n_{1}, n_{2}, \ldots, n_{m}, by ss the number of 11's and by tt the number of 22's. We have
A(n)=2s((t1)2t1+(t3)2t3+(t5)2t5+) A(n) = 2^{s} \left( \binom{t}{1} 2^{t-1} + \binom{t}{3} 2^{t-3} + \binom{t}{5} 2^{t-5} + \cdots \right)
and
B(n)=2s((t0)2t+(t2)2t2+(t4)2t4+). B(n) = 2^{s} \left( \binom{t}{0} 2^{t} + \binom{t}{2} 2^{t-2} + \binom{t}{4} 2^{t-4} + \cdots \right).
We deduce that
s(n)=2s(((t0)+(t1))2t+((t2)+(t3))2t2+)=2s((t+11)2t+(t+13)2t2+)=2s(2+1)t+1(21)t+12=2s1(3t+11). \begin{aligned} s(n) & = 2^{s} \left( (\binom{t}{0} + \binom{t}{1}) 2^{t} + (\binom{t}{2} + \binom{t}{3}) 2^{t-2} + \cdots \right) \\ & = 2^{s} \left( \binom{t+1}{1} 2^{t} + \binom{t+1}{3} 2^{t-2} + \cdots \right) \\ & = 2^{s} \cdot \frac{(2+1)^{t+1} - (2-1)^{t+1}}{2} = 2^{s-1} (3^{t+1} - 1). \end{aligned}

a. If the first digit on the left of nn is 22 then
n2000r111s222t1=23r+s+t1+3s123t1+23t112=43r+s+3s+123t11 \begin{aligned} n \geq \overline{2 \underbrace{00 \cdots 0}_{r} \underbrace{11 \cdots 1}_{s} \underbrace{22 \cdots 2}_{t-1}} & = 2 \cdot 3^{r+s+t-1} + \frac{3^{s} - 1}{2} \cdot 3^{t-1} + 2 \cdot \frac{3^{t-1} - 1}{2} \\ & = \frac{4 \cdot 3^{r+s} + 3^{s} + 1}{2} \cdot 3^{t-1} - 1 \end{aligned}
Therefore
ns(n)(43r+1)3s92s+123t11+2s1. n - s(n) \geq \frac{(4 \cdot 3^{r} + 1) \cdot 3^{s} - 9 \cdot 2^{s} + 1}{2} \cdot 3^{t-1} - 1 + 2^{s-1}.
- If r1r \geq 1 then ns(n)139+12131+12>0n - s(n) \geq \frac{13 - 9 + 1}{2} \cdot \frac{1}{3} - 1 + \frac{1}{2} > 0
- If r=0r = 0 and s2s \geq 2 then
ns(n)453s2362s2+123t11+2>0. n - s(n) \geq \frac{45 \cdot 3^{s-2} - 36 \cdot 2^{s-2} + 1}{2} \cdot 3^{t-1} - 1 + 2 > 0.
- If r=0r = 0 and s=1s = 1 then n2221t=3t+12<3t+11=s(n)n \leq \overline{22 \cdots 2 1}_{t} = 3^{t+1} - 2 < 3^{t+1} - 1 = s(n).
- If r=s=0r = s = 0 then n=222t=3t1<3t+112=s(n)n = \overline{22 \cdots 2}_{t} = 3^{t} - 1 < \frac{3^{t+1} - 1}{2} = s(n).

b. If the first digit on the left of nn is 11 then s1s \geq 1 and
n1000r111s1222t=3r+s+t1+3s1123t+23t12=23r+s1+3s1+123t1 \begin{aligned} n \geq \overline{1 \underbrace{00 \cdots 0}_{r} \underbrace{11 \cdots 1}_{s-1} \underbrace{22 \cdots 2}_{t}} & = 3^{r+s+t-1} + \frac{3^{s-1} - 1}{2} \cdot 3^{t} + 2 \cdot \frac{3^{t} - 1}{2} \\ & = \frac{2 \cdot 3^{r+s-1} + 3^{s-1} + 1}{2} \cdot 3^{t} - 1 \end{aligned}
Therefore
ns(n)(23r+1)3s162s1+123t+2s11. n - s(n) \geq \frac{(2 \cdot 3^{r} + 1) \cdot 3^{s-1} - 6 \cdot 2^{s-1} + 1}{2} \cdot 3^{t} + 2^{s-1} - 1.
- If r1r \geq 1 and because s1s \geq 1 we have
ns(n)73s162s1+123t+2s111+11>0. n - s(n) \geq \frac{7 \cdot 3^{s-1} - 6 \cdot 2^{s-1} + 1}{2} \cdot 3^{t} + 2^{s-1} - 1 \geq 1 + 1 - 1 > 0.
- If r=0r = 0 and s3s \geq 3 then
ns(n)3(3s12s)+123t+2s112+41>0. n - s(n) \geq \frac{3 \cdot (3^{s-1} - 2^{s}) + 1}{2} \cdot 3^{t} + 2^{s-1} - 1 \geq 2 + 4 - 1 > 0.
- If r=0r = 0 and s=2s = 2 then n1222t1=2(3t+11)=s(n)n \leq \overline{1 \underbrace{22 \cdots 2}_{t} 1} = 2(3^{t+1} - 1) = s(n), and the equality is satisfied precisely when n=1222t1n = \overline{1 \underbrace{22 \cdots 2}_{t} 1}.
- If r=0r = 0 and s=1s = 1 then
n=1222t=3t+13t1<3t+11=s(n). n = \overline{1 \underbrace{22 \cdots 2}_{t}} = 3^{t+1} - 3^{t} - 1 < 3^{t+1} - 1 = s(n).

Finally, we deduce that if in the digits of nn written in base 33,
(a) there is at least one 00, or three 11's, or no 00's and two 11's with the digit on the left is 22, then s(n)<ns(n) < n;
(b) n=12221n = \overline{122 \cdots 21}, then s(n)=ns(n) = n;
(c) there are no 00's and two 11's with the digit on the left is 11 and the digit on the right is 22, or there are no 00's and at most one 11, then s(n)>ns(n) > n.

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 and solution reproduced as published; topic and difficulty added by this site.