Olympiad Maths Prep

Track / Stage 7 / 13 of 300 #1413 of 2000

Problem 1413

National olympiad second round; IMO P1/P4
Number theory Difficulty 7.0 Prove it

Example 5 Given a positive integer nn, let f(n)f(n) be the smallest positive integer such that k=1f(n)k\sum_{k=1}^{f(n)} k is divisible by nn. Prove that f(n)=2n1f(n)=2n-1 if and only if nn is a power of 2.

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

The first half of the problem is quite easy to prove. If n=2mn=2^{m}, then on the one hand,
k=12n1k=(2n1)×2n2=(2m+11)2m\sum_{k=1}^{2 n-1} k=\frac{(2 n-1) \times 2 n}{2}=\left(2^{m+1}-1\right) \cdot 2^{m}

is divisible by 2m=n2^{m}=n. On the other hand, if r2n2r \leqslant 2 n-2, then
k=1rk=r(r+1)2\sum_{k=1}^{r} k=\frac{r(r+1)}{2}

is not divisible by 2m2^{m}, because one of rr and r+1r+1 is odd, and the other does not exceed (2n2)+1=2m+11(2 n-2)+1=2^{m+1}-1, and thus is not divisible by 2m+12^{m+1}. Combining these two aspects, we know that f(2m)=2m+11f\left(2^{m}\right)=2^{m+1}-1.

Now suppose nn is not a power of 2, i.e., n=2man=2^{m} a, where m0,a>1m \geqslant 0, a>1 is an odd number. We will prove that there exists a positive integer r<2n1r<2 n-1 such that 2m+1r2^{m+1} \mid r and a(r+1)a \mid (r+1), so that
k=1rk=r(r+1)2\sum_{k=1}^{r} k=\frac{r(r+1)}{2}

is divisible by 2ma=n2^{m} a=n, and thus f(n)<2n1f(n)<2 n-1.
To prove the above claim, we consider
x0(mod2m+1),x1(moda)x \equiv 0\left(\bmod 2^{m+1}\right), x \equiv -1(\bmod a)

Since (2m+1,a)=1\left(2^{m+1}, a\right)=1, by the Chinese Remainder Theorem, the system of congruences (1) must have a solution x0x_{0}, and all solutions are xx0(mod2m+1a)x \equiv x_{0}\left(\bmod 2^{m+1} a\right), i.e., xx0(mod2n)x \equiv x_{0}(\bmod 2 n). Therefore, we can determine an rr that satisfies (1) and 0<r2n0<r \leqslant 2 n. Furthermore, by the second congruence in (1), we know that r2nr \neq 2 n. And by the first congruence, we see that r2n1r \neq 2 n-1, so in fact r<2n1r<2 n-1. This proves the existence of an rr that meets the requirements.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.