Number theoryDifficulty 7.1National olympiad, round 2Prove itSaudi Arabia
For each positive integer n, define s(n)=∑k=0nrk, where rk is the remainder when (kn) is divided by 3. Find all positive integers n such that s(n)≥n.
Solution
Let 0≤k≤n be two integers written in base 3 as n=(3)nmnm−1⋯n1n0,k=(3)kmkm−1⋯k1k0 such that nm=0. We know from Lucas's theorem that rk≡(kn)≡i=0∏m(kini)(mod3) If there exists 0≤i≤m such that ki>ni then (kini)=0 and therefore rk=0. Therefore, from now on we will restrict to 0≤k≤n with ki≤ni for all 0≤i≤m. Let 0≤i≤m. If ni=0 then ki=0. If ni=1 then ki∈{0,1}. In all these cases (kini)=1. If ni=2 then ki∈{0,1,2} and (kini)=1 if ki=1 and (kini)=2 if ki=1. Therefore, if the number a of pairs (ni,ki)=(2,1), when 0≤i≤m, is odd then (kn)≡2a≡2(mod3), otherwise (kn)≡1(mod3). We deduce that s(n)=2A(n)+B(n), where A(n) is the number of pairs of integers (n,k) such that 0≤ki≤ni for all 0≤i≤m and the number of pairs (ni,ki)=(2,1), when 0≤i≤m, is odd, while B(n) is the number of pairs of integers (n,k) such that 0≤ki≤ni for all 0≤i≤m and the number of pairs (ni,ki)=(2,1), when 0≤i≤m, is even. Denote by r the number of 0's in n0,n1,n2,…,nm, by s the number of 1's and by t the number of 2's. We have A(n)=2s((1t)2t−1+(3t)2t−3+(5t)2t−5+⋯) and B(n)=2s((0t)2t+(2t)2t−2+(4t)2t−4+⋯). We deduce that s(n)=2s(((0t)+(1t))2t+((2t)+(3t))2t−2+⋯)=2s((1t+1)2t+(3t+1)2t−2+⋯)=2s⋅2(2+1)t+1−(2−1)t+1=2s−1(3t+1−1).
a. If the first digit on the left of n is 2 then n≥2r00⋯0s11⋯1t−122⋯2=2⋅3r+s+t−1+23s−1⋅3t−1+2⋅23t−1−1=24⋅3r+s+3s+1⋅3t−1−1 Therefore n−s(n)≥2(4⋅3r+1)⋅3s−9⋅2s+1⋅3t−1−1+2s−1. - If r≥1 then n−s(n)≥213−9+1⋅31−1+21>0 - If r=0 and s≥2 then n−s(n)≥245⋅3s−2−36⋅2s−2+1⋅3t−1−1+2>0. - If r=0 and s=1 then n≤22⋯21t=3t+1−2<3t+1−1=s(n). - If r=s=0 then n=22⋯2t=3t−1<23t+1−1=s(n).
b. If the first digit on the left of n is 1 then s≥1 and n≥1r00⋯0s−111⋯1t22⋯2=3r+s+t−1+23s−1−1⋅3t+2⋅23t−1=22⋅3r+s−1+3s−1+1⋅3t−1 Therefore n−s(n)≥2(2⋅3r+1)⋅3s−1−6⋅2s−1+1⋅3t+2s−1−1. - If r≥1 and because s≥1 we have n−s(n)≥27⋅3s−1−6⋅2s−1+1⋅3t+2s−1−1≥1+1−1>0. - If r=0 and s≥3 then n−s(n)≥23⋅(3s−1−2s)+1⋅3t+2s−1−1≥2+4−1>0. - If r=0 and s=2 then n≤1t22⋯21=2(3t+1−1)=s(n), and the equality is satisfied precisely when n=1t22⋯21. - If r=0 and s=1 then n=1t22⋯2=3t+1−3t−1<3t+1−1=s(n).
Finally, we deduce that if in the digits of n written in base 3, (a) there is at least one 0, or three 1's, or no 0's and two 1's with the digit on the left is 2, then s(n)<n; (b) n=122⋯21, then s(n)=n; (c) there are no 0's and two 1's with the digit on the left is 1 and the digit on the right is 2, or there are no 0's and at most one 1, then s(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.