Maths Olympiad Prep

Library / Singapore Mathematical Olympiad (SMO) /20 of 52

Singapore Mathematical Olympiad (SMO)

Number theory Difficulty 5.6 AIME, harder Prove it Singapore

Find all positive integers m,nm, n satisfying n!+2n−1=2mn! + 2^{n-1} = 2^m.

Solution

We first check that n=1,2,4n = 1, 2, 4 are solutions among n≤4n \le 4, with m=1,2,5m = 1, 2, 5 respectively.

We now assume that n≥5n \ge 5. By Legendre's formula, we know that v2(n!)=n−s2(n)v_2(n!) = n - s_2(n) where s2(n)s_2(n) is the number of non-zero digits in the binary representation of nn. Thus v2(n!)≤n−1v_2(n!) \le n - 1.

If v2(n!)=a<n−1v_2(n!) = a < n - 1, letting odd(xx) denote the odd part of xx, we have
odd(n!)+2n−1−a=2m−a \mathrm{odd}(n!) + 2^{n-1-a} = 2^{m-a}
which cannot happen as odd(n!)\mathrm{odd}(n!) is odd and the other two terms are even. Hence v2(n!)=n−1v_2(n!) = n - 1 and we must have s2(n)=1⇒ns_2(n) = 1 \Rightarrow n is a power of 2.

Let n=2an = 2^a. Then a≥3a \ge 3. We claim that odd(n!)≡3(mod8)\mathrm{odd}(n!) \equiv 3 \pmod 8. To see so, we pair up ii with n−i=2a−in-i = 2^a-i. If v2(i)<a−2v_2(i) < a-2, then odd(2a−i)≡−odd(i)(mod8)\mathrm{odd}(2^a-i) \equiv -\mathrm{odd}(i) \pmod 8 and so we have
odd(i)⋅odd(2a−i)≡−odd(i)2≡−1(mod8) \mathrm{odd}(i) \cdot \mathrm{odd}(2^a - i) \equiv -\mathrm{odd}(i)^2 \equiv -1 \pmod 8
and we have an even number of such pairs. This gives us a product of 1. The remaining ii's are of simply 2a−2,2a−12^{a-2}, 2^{a-1} and 3⋅2a−23 \cdot 2^{a-2}, whose odd part multiply to 3 mod 8. Hence the total product is 3 mod 8 as desired. Then
n!+2n−1=2m⇒odd(n!)+1=2m−n−1⇒2m−n−1≡4(mod8)⇒2m−n−1≤4 n! + 2^{n-1} = 2^m \Rightarrow \mathrm{odd}(n!) + 1 = 2^{m-n-1} \Rightarrow 2^{m-n-1} \equiv 4 \pmod 8 \Rightarrow 2^{m-n-1} \le 4
Thus odd(n!)≤4\mathrm{odd}(n!) \le 4 which leads to n≤4n \le 4. So there are no other solutions.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.