Number theoryDifficulty 6.6National OlympiadProve itBrazil
What is the smallest positive integer n such that there exists a positive integer k such that the last 2012 digits of nk are all equal to 1?
Solution
Answer: 71.
Since 2012 ones11…1=9102012−1, the problem is equivalent to finding the smallest n such that, for some k, nk9nk≡9102012−1(mod102012)≡−1(mod102012)⟺n−k≡−9(mod102012)⟺{n−k≡−9(mod22012)n−k≡−9(mod52012)
Let's look at n−kmod8 first. It's immediate that n is odd. Since 12≡32≡52≡72≡1(mod8), we must have n≡7(mod8) and −k odd. Now look at it mod 16: let k=−m and n=8u−1. Then (8u−1)m≡−1+8um(mod16)
and nm8um−1≡−9(mod16)≡−9(mod16)⟺um≡1(mod2),
that is, u is odd. Therefore n=8(2t+1)−1≡7(mod16).
Now look at n−kmod5: since −k is odd, and 13≡1(mod5), 23≡3(mod5), 33≡2(mod5) and 43≡4(mod5), we must have n≡1(mod5). Putting everything together, we have n≡7(mod16) and n≡1(mod5)⟹n≡71(mod80), and thus n≥71.
We claim that n=71 does the job. First notice that, by the Lifting the Exponent lemma, ν2(71N−1)=ν2(712−1)+ν2(N)−1=ν2(N)+3 and ν5(71N−1)=ν5(71−1)+ν5(N)=ν5(N)+1.
Now, notice that this implies 71v≡71w(mod2t)⟺71v−w≡1(mod2t)⟺ν2(v−w)+3≥t⟺2t−3∣v−w⟺v≡w(mod2t−3). We analyze now the possible residues of 71N(mod2t): first, we know that 71≡7(mod16), and 712≡1(mod16), so all residues 71N(mod2t) are congruent to either 1 or 7(mod16), so one eighth of the residues appear, in a total of 2t−3 residues. But 71v≡71w(mod2t)⟺v≡w(mod2t−3), so there are at most 2t−3 residues. This means that the residues are all numbers congruent to 1 or 7(mod16). So, for all t≥4 there is N such that 71N≡−9(mod2t). Notice that N is unique mod 2t−3.
The same argument applies mod 5t: all residues of 71N(mod5t) are congruent to 1(mod5) and 71v≡71w(mod5t)⟺71v−w≡1(mod5t)⟺ν5(v−w)+1≥t⟺5t−1∣v−w⟺v≡w(mod5t−1). One fifth of the residues appear, all of them congruent to 1 mod 5. So the residues are all numbers congruent to 1 mod 5, and for all t≥2 there is N such that 71N≡−9(mod5t). Notice that N is unique mod 5t−1.
We can finish the problem now: we only need to find N that is congruent to a number mod 2t and to a number mod 5t, but it exists due to the Chinese remainder theorem. Now plug t=2012.
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.