Olympiad Maths Prep

Library / /6 of 11

Number theory Difficulty 9.0 Shortlist Prove it IMO

Let Z>0\mathbb{Z}_{>0} denote the set of positive integers. For any positive integer kk, a function f:Z>0Z>0f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0} is called kk-good if gcd(f(m)+n,f(n)+m)k\operatorname{gcd}(f(m)+n, f(n)+m) \leqslant k for all mnm \neq n. Find all kk such that there exists a kk-good function.

Solutions — 2

Solution 1

We first show that there is no 11-good function. Suppose that there exists a function ff such that Gf(m,n)=1G_{f}(m, n)=1 for all mnm \neq n. Now, if there are two distinct even numbers mm and nn such that f(m)f(m) and f(n)f(n) are both even, then 2Gf(m,n)2 \mid G_{f}(m, n), a contradiction. A similar argument holds if there are two distinct odd numbers mm and nn such that f(m)f(m) and f(n)f(n) are both odd. Hence we can choose an even mm and an odd nn such that f(m)f(m) is odd and f(n)f(n) is even. This also implies that 2Gf(m,n)2 \mid G_{f}(m, n), a contradiction.

We now construct a 22-good function. Define f(n)=2g(n)+1n1f(n)=2^{g(n)+1}-n-1, where gg is defined recursively by g(1)=1g(1)=1 and g(n+1)=(2g(n)+1)!g(n+1)=\left(2^{g(n)+1}\right)!.

For any positive integers m>nm>n, set
A=f(m)+n=2g(m)+1m+n1,B=f(n)+m=2g(n)+1n+m1. A=f(m)+n=2^{g(m)+1}-m+n-1, \quad B=f(n)+m=2^{g(n)+1}-n+m-1 .
We need to show that gcd(A,B)2\operatorname{gcd}(A, B) \leqslant 2. First, note that A+B=2g(m)+1+2g(n)+12A+B=2^{g(m)+1}+2^{g(n)+1}-2 is not divisible by 44, so that 4gcd(A,B)4 \nmid \operatorname{gcd}(A, B). Now we suppose that there is an odd prime pp for which pgcd(A,B)p \mid \operatorname{gcd}(A, B) and derive a contradiction.

We first claim that 2g(m1)+1B2^{g(m-1)+1} \geqslant B. This is a rather weak bound; one way to prove it is as follows. Observe that g(k+1)>g(k)g(k+1)>g(k) and hence 2g(k+1)+12g(k)+1+12^{g(k+1)+1} \geqslant 2^{g(k)+1}+1 for every positive integer kk. By repeatedly applying this inequality, we obtain 2g(m1)+12g(n)+1+(m1)n=B2^{g(m-1)+1} \geqslant 2^{g(n)+1}+(m-1)-n=B.

Now, since pBp \mid B, we have p1<B2g(m1)+1p-1<B \leqslant 2^{g(m-1)+1}, so that p1(2g(m1)+1)!=g(m)p-1 \mid\left(2^{g(m-1)+1}\right)!=g(m). Hence 2g(m)1(modp)2^{g(m)} \equiv 1(\bmod p), which yields A+B2g(n)+1(modp)A+B \equiv 2^{g(n)+1}(\bmod p). However, since pA+Bp \mid A+B, this implies that p=2p=2, a contradiction.

Solution 2

We provide an alternative construction of a 22-good function ff.
Let P\mathcal{P} be the set consisting of 44 and all odd primes. For every pPp \in \mathcal{P}, we say that a number a{0,1,,p1}a \in\{0,1, \ldots, p-1\} is pp-useful if a≢a(modp)a \not \equiv -a(\bmod p). Note that a residue modulo pp which is neither 00 nor 22 is pp-useful (the latter is needed only when p=4p=4).

We will construct ff recursively; in some steps, we will also define a pp-useful number apa_{p}. After the mthm^{\text{th}} step, the construction will satisfy the following conditions:
(i) The values of f(n)f(n) have already been defined for all nmn \leqslant m, and pp-useful numbers apa_{p} have already been defined for all pm+2p \leqslant m+2;
(ii) If nmn \leqslant m and pm+2p \leqslant m+2, then f(n)+n≢ap(modp)f(n)+n \not \equiv a_{p}(\bmod p);
(iii) gcd(f(n1)+n2,f(n2)+n1)2\operatorname{gcd}\left(f\left(n_{1}\right)+n_{2}, f\left(n_{2}\right)+n_{1}\right) \leqslant 2 for all n1<n2mn_{1}<n_{2} \leqslant m.
If these conditions are satisfied, then ff will be a 22-good function.

Step 1. Set f(1)=1f(1)=1 and a3=1a_{3}=1. Clearly, all the conditions are satisfied.

**Step mm, for m2m \geqslant 2.** We need to determine f(m)f(m) and, if m+2Pm+2 \in \mathcal{P}, the number am+2a_{m+2}.

Defining f(m)f(m). Let Xm={pP:pf(n)+mX_{m}=\{p \in \mathcal{P}: p \mid f(n)+m for some n<m}n<m\}. We will determine f(m)modpf(m) \bmod p for all pXmp \in X_{m} and then choose f(m)f(m) using the Chinese Remainder Theorem.
Take any pXmp \in X_{m}. If pm+1p \leqslant m+1, then we define f(m)apm(modp)f(m) \equiv -a_{p}-m(\bmod p). Otherwise, if pm+2p \geqslant m+2, then we define f(m)0(modp)f(m) \equiv 0(\bmod p).

Defining am+2a_{m+2}. Now let p=m+2p=m+2 and suppose that pPp \in \mathcal{P}. We choose apa_{p} to be a residue modulo pp that is not congruent to 0,20,2, or f(n)+nf(n)+n for any nmn \leqslant m. Since f(1)+1=2f(1)+1=2, there are at most m+1<pm+1<p residues to avoid, so we can always choose a remaining residue.

We first check that (ii) is satisfied. We only need to check it if p=m+2p=m+2 or n=mn=m. In the former case, we have f(n)+n≢ap(modp)f(n)+n \not \equiv a_{p}(\bmod p) by construction. In the latter case, if n=mn=m and pm+1p \leqslant m+1, then we have f(m)+map≢ap(modp)f(m)+m \equiv -a_{p} \not \equiv a_{p}(\bmod p), where we make use of the fact that apa_{p} is pp-useful.

Now we check that (iii) holds. Suppose, to the contrary, that pgcd(f(n)+m,f(m)+n)p \mid \operatorname{gcd}(f(n)+m, f(m)+n) for some n<mn<m. Then pXmp \in X_{m} and pf(m)+np \mid f(m)+n. If pm+2p \geqslant m+2, then 0f(m)+nn(modp)0 \equiv f(m)+n \equiv n(\bmod p), which is impossible since n<m<pn<m<p.
Otherwise, if pm+1p \leqslant m+1, then
0(f(m)+n)+(f(n)+m)(f(n)+n)+(f(m)+m)(f(n)+n)ap(modp). 0 \equiv (f(m)+n)+(f(n)+m) \equiv (f(n)+n)+(f(m)+m) \equiv (f(n)+n)-a_{p}(\bmod p) .
This implies that f(n)+nap(modp)f(n)+n \equiv a_{p}(\bmod p), a contradiction with (ii).

Looking for a route rather than 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.