Maths Olympiad Prep

Library / /478 of 520

Number theory Difficulty 7.4 National olympiad, round 2 Prove it

Find all functions f:Z>0Z>0f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0} such that for all positive integers mm, nn, and aa the following conditions hold:
a) f(f(m)f(n))=mnf(f(m) f(n))=m n,
b) f(2024a+1)=2024a+1f(2024 a+1)=2024 a+1.

Solution

If we were allowed to plug in a=0a=0, we would find f(1)=1f(1)=1. With n=1n=1, we then get f(f(m))=mf(f(m))=m, so ff is bijective. Unfortunately, we are not allowed to plug in a=0a=0, but it does put us on the right track.

We start by plugging in n=1n=1. This gives us f(f(m)f(1))=mf(f(m) f(1))=m, which means that ff is bijective. Indeed, if f(m)=f(n)f(m)=f(n), then we directly get m=f(f(m)f(1))=f(f(n)f(1))=nm=f(f(m) f(1))=f(f(n) f(1))=n and for every mm there is an aa such that f(a)=mf(a)=m, namely a=f(m)f(1)a=f(m) f(1). Now we plug in m=nm=n, which gives us f(f(m)2)=m2=f(f(m2)f(1))f(f(m)^2)=m^2=f(f(m^2) f(1)). Due to the injectivity of ff, it follows that f(m)2=f(m2)f(1)f(m)^2=f(m^2) f(1). Choose now m1m_1 such that f(m1)=1f(m_1)=1. (From our proof of surjectivity, we can choose m1=f(1)2m_1=f(1)^2, but that is not important.) If we plug in m=m1m=m_1 in the above, we get 1=f(m12)f(1)1=f(m_1^2) f(1). In particular, f(1)f(1) is a divisor of 1, and since it must be a natural number, we conclude that f(1)=1f(1)=1.

If we now plug in n=1n=1 again, we find that f(f(m))=mf(f(m))=m. Now we can plug in f(m)f(m) and f(n)f(n) for mm and nn so that we get the more classical equation

f(mn)=f(f(f(m))f(f(n)))=f(m)f(n) f(m n)=f(f(f(m)) f(f(n)))=f(m) f(n)

This means that ff is determined by the values f(p)f(p) with pp prime.
Suppose we have an arbitrary prime number pp, and let mm and nn be natural numbers such that f(p)=mnf(p)=m n. It follows that f(m)f(n)=f(mn)=f(f(p))=pf(m) f(n)=f(m n)=f(f(p))=p. Since f(m)f(m) and f(n)f(n) are natural numbers, it must be that f(m)=1f(m)=1 or f(n)=1f(n)=1. Due to injectivity, the only mm for which f(m)=1f(m)=1 is the number m=1m=1. Therefore, m=1m=1 or n=1n=1. We conclude that f(p)f(p) is a prime number.

Now suppose that p2024p \nmid 2024. In particular, this means that gcd(p,2024)=1\operatorname{gcd}(p, 2024)=1, so pp has a multiplicative inverse modulo 2024. Let bb be a natural number in the residue class of the inverse, i.e., bp1mod2024b p \equiv 1 \bmod 2024. Since bpp>1b p \geq p > 1, it follows from the second equation that f(bp)=bpf(b p)=b p, but also that f(bp+2024p)=bp+2024pf(b p + 2024 p)=b p + 2024 p. From the previous paragraph, however, it follows that f(bp)=f(b)f(p)f(b p)=f(b) f(p) and f((b+2024)p)=f(b+2024)f(p)f((b+2024) p)=f(b+2024) f(p). This means that f(p)f(p) is a divisor of both bpb p and bp+2024pb p + 2024 p. Now we calculate that

gcd(bp,bp+2024p)=gcd(bp,2024p)=gcd(b,2024)p=p, \operatorname{gcd}(b p, b p + 2024 p) = \operatorname{gcd}(b p, 2024 p) = \operatorname{gcd}(b, 2024) p = p,

since bb is the multiplicative inverse of pp modulo 2024. Due to injectivity, we know that f(p)1f(p) \neq 1, so f(p)pf(p) \mid p implies that f(p)=pf(p)=p.

Suppose for a p2024p \mid 2024 that f(p)=qf(p)=q, with qpq \neq p another prime number. Then it follows that f(q)=f(f(p))=pf(q)=f(f(p))=p. So all prime numbers that do not map to themselves by ff form pairs (p,q)(p, q) with f(p)=qf(p)=q and f(q)=pf(q)=p. Since 2024=2311232024=2^3 \cdot 11 \cdot 23, we have four solutions:

- f(p)=pf(p)=p for all prime numbers pp. So ff is the identity,
- f(2)=11,f(11)=2f(2)=11, f(11)=2 and f(p)=pf(p)=p for all p{2,11}p \notin \{2,11\},
- f(2)=23,f(23)=2f(2)=23, f(23)=2 and f(p)=pf(p)=p for all p{2,23}p \notin \{2,23\},
- f(11)=23,f(23)=11f(11)=23, f(23)=11 and f(p)=pf(p)=p for all p{11,23}p \notin \{11,23\}.

It is easy to check that these functions also satisfy the conditions.

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: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.