Maths Olympiad Prep

Track / Stage 7 / 55 of 300 #2095 of 2604

Problem 2095

National Olympiad second round; IMO P1/P4
Number theory Difficulty 7.2 Prove it Japanese Mathematical Olympiad · Japan

Let S={0,1,2,…,8}S = \{0, 1, 2, \dots, 8\}. How many functions f:S→Sf : S \to S satisfy the following condition: For any elements x,y,z∈Sx, y, z \in S, if x+y−zx+y-z is divisible by 99, then f(x)f(y)−f(f(z))f(x)f(y) - f(f(z)) is also divisible by 99?

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Next problem →

Official solution

858858

In this solution, x≡yx \equiv y always means that x−yx-y is divisible by 99. Furthermore, for any integer xx, we denote by [x][x] the unique element x′∈Sx' \in S satisfying x≡x′x \equiv x'. Note that for any integers ss and tt, we have [[s−t]+t]=[s][[s-t]+t] = [s] and [s[t]]=[st][s[t]] = [st].

Under this notation, the condition in the problem can be rewritten as
f(x)f(y)≡f(f([x+y])) f(x)f(y) \equiv f(f([x+y]))
for any elements x,y∈Sx, y \in S. We denote this equation by P(x,y)P(x, y).

Define T={f(x)∣x∈S}T = \{f(x) \mid x \in S\}. For any elements s=f(x)s = f(x) and t=f(y)t = f(y) in TT, note that
[st]=[f(x)f(y)]=f(f([x+y]))∈T. [st] = [f(x)f(y)] = f(f([x+y])) \in T.

First, consider the case where TT contains a multiple of 33. Let aa be such an element. Then, since 0=[a2]∈T0 = [a^2] \in T, there exists some b∈Sb \in S such that f(b)=0f(b) = 0. Therefore, we have f(f(x))=0f(f(x)) = 0 for any x∈Sx \in S since P([x−b],b)P([x-b], b) gives
f(f(x))≡f([x−b])f(b)=0. f(f(x)) \equiv f([x-b])f(b) = 0.
Furthermore, f(x)f(x) is a multiple of 33 since P(x,x)P(x, x) gives
f(x)2≡f(f([2x]))=0. f(x)^2 \equiv f(f([2x])) = 0.
Conversely, suppose that for every x∈Sx \in S, we have f(f(x))=0f(f(x)) = 0 and f(x)f(x) is a multiple of 33. Then such ff satisfies the condition because for any x,y∈Sx, y \in S, both sides of P(x,y)P(x, y) are divisible by 99.

Since TT contains 00, the condition that f(x)f(x) is a multiple of 33 for all x∈Sx \in S is equivalent to TT being one of {0}\{0\}, {0,3}\{0, 3\}, {0,6}\{0, 6\}, or {0,3,6}\{0, 3, 6\}. Furthermore, the condition that f(f(x))=0f(f(x)) = 0 for all x∈Sx \in S is equivalent to saying that f(x)=0f(x) = 0 for all x∈Tx \in T. In the following, we consider each of the four possible cases for TT and count the number of possible functions ff in each case.

* When T={0}T = \{0\}, there is only one function ff, namely f(x)=0f(x) = 0 for all xx.
* When T={0,3}T = \{0, 3\}, the number of such functions ff is the number of ways to assign f(x)=0f(x) = 0 or 33 for each x∈S∖T={1,2,4,5,6,7,8}x \in S \setminus T = \{1, 2, 4, 5, 6, 7, 8\}, such that there is at least one xx with f(x)=3f(x) = 3. There is exactly one way to assign all values to 00, so the number of valid functions ff is 27−1=1272^7 - 1 = 127.
* When T={0,6}T = \{0, 6\}, by the same reason, the number of such functions ff is also 127127.
* When T={0,3,6}T = \{0, 3, 6\}, the number of such functions ff is the number of ways to assign f(x)=0,3f(x) = 0, 3, or 66 for each x∈S∖T={1,2,4,5,7,8}x \in S \setminus T = \{1, 2, 4, 5, 7, 8\} such that there is at least one xx with f(x)=3f(x) = 3 and at least one yy with f(y)=6f(y) = 6. There are 262^6 ways where f(x)≠3f(x) \neq 3 for all x∈S∖Tx \in S \setminus T, and 262^6 ways where f(y)≠6f(y) \neq 6 for all y∈S∖Ty \in S \setminus T, and one way where f(x)≠3,6f(x) \neq 3, 6 for all x∈S∖Tx \in S \setminus T. So the number of valid functions ff in this case is 36−26−26+1=6023^6 - 2^6 - 2^6 + 1 = 602.

1+127+127+602=857. 1 + 127 + 127 + 602 = 857.

Next, we consider the case where TT does not contain any multiples of 33. Since TT is nonempty, we can take an element aa of TT. Because aa is not divisible by 33, Euler's theorem gives a6≡1a^6 \equiv 1, so we have 1=[a6]∈T1 = [a^6] \in T. Thus, there exists some b∈Sb \in S such that f(b)=1f(b) = 1. Therefore, we have f(0)=f(1)f(0) = f(1) since P(b,0)P(b, 0) gives
f(0)=f(b)f(0)≡f(f(b))=f(1). f(0) = f(b)f(0) \equiv f(f(b)) = f(1).
Furthermore, for any x∈Sx \in S, from P(x,[−x])P(x, [-x]) and P([x+1],[−x])P([x+1], [-x]), we obtain
f(x)f([−x])≡f(f(0))=f(f(1))≡f([x+1])f([−x]). f(x)f([-x]) \equiv f(f(0)) = f(f(1)) \equiv f([x+1])f([-x]).
Thus, we have
f([−x])(f([x+1])−f(x))≡0. f([-x]) (f([x+1]) - f(x)) \equiv 0.
Since f([−x])f([-x]) is not divisible by 33, we conclude that
f([x+1])=f(x) f([x+1]) = f(x)
holds for every x∈Sx \in S. Therefore, the set TT has exactly one element. Since 1∈T1 \in T, we must have T={1}T = \{1\}, which does not contain a multiple of 33. The constant function f(x)=1f(x) = 1 is the only function with this property. Conversely, this function satisfies the condition because both sides of P(x,y)P(x, y) equal 11 for any x,y∈Sx, y \in S.

Hence, the total number of possible functions ff is 857+1=858857 + 1 = 858.

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