Maths Olympiad Prep

Library / /8 of 16

Number theory Difficulty 7.2 National olympiad, round 2 Prove it Japan

Let S={0,1,2,,8}S = \{0, 1, 2, \dots, 8\}. How many functions f:SSf : S \to S satisfy the following condition: For any elements x,y,zSx, y, z \in S, if x+yzx+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?

Solution

858858

In this solution, xyx \equiv y always means that xyx-y is divisible by 99. Furthermore, for any integer xx, we denote by [x][x] the unique element xSx' \in S satisfying xxx \equiv x'. Note that for any integers ss and tt, we have [[st]+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,ySx, y \in S. We denote this equation by P(x,y)P(x, y).

Define T={f(x)xS}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 bSb \in S such that f(b)=0f(b) = 0. Therefore, we have f(f(x))=0f(f(x)) = 0 for any xSx \in S since P([xb],b)P([x-b], b) gives
f(f(x))f([xb])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)2f(f([2x]))=0. f(x)^2 \equiv f(f([2x])) = 0.
Conversely, suppose that for every xSx \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,ySx, 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 xSx \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 xSx \in S is equivalent to saying that f(x)=0f(x) = 0 for all xTx \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 xST={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 271=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 xST={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 xSTx \in S \setminus T, and 262^6 ways where f(y)6f(y) \neq 6 for all ySTy \in S \setminus T, and one way where f(x)3,6f(x) \neq 3, 6 for all xSTx \in S \setminus T. So the number of valid functions ff in this case is 362626+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 a61a^6 \equiv 1, so we have 1=[a6]T1 = [a^6] \in T. Thus, there exists some bSb \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 xSx \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 xSx \in S. Therefore, the set TT has exactly one element. Since 1T1 \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,ySx, y \in S.

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

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: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.