Maths Olympiad Prep

Library / /8 of 9

, 2013

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

There are 2013 cards numbered 00, 11, 22, \ldots, 20122012. Initially, all the cards are placed with the face with a written number down. Then, we perform for each i=1,2,,2013i = 1, 2, \dots, 2013 the following operation ii starting with i=1i = 1 and with increasing order ending up with i=2013i = 2013:

Operation ii: Flip each of the ii cards having the number 2013ji\left\lfloor \frac{2013j}{i} \right\rfloor for j=0,1,,i1j = 0, 1, \dots, i - 1.

How many cards are with their faces up (showing their numbers) at the end of all the operations?

Here we denote by [r][r] for each real number rr the greatest integer less than or equal to rr.

Solution

Let n=2013n = 2013 throughout the subsequent discussion on this problem. For any real number rr denote by r\lfloor r \rfloor the smallest integer greater than or equal to rr. In order to obtain the desired solution, we prove the following two lemmas.

Lemma 1. For 1in1 \le i \le n and 0xn10 \le x \le n-1, we have i(x+1)nixn=1\lfloor \frac{i(x+1)}{n} \rfloor - \lfloor \frac{ix}{n} \rfloor = 1 holds if the card with number xx is turned over at the operation ii, and i(x+1)nixn=0\lfloor \frac{i(x+1)}{n} \rfloor - \lfloor \frac{ix}{n} \rfloor = 0, otherwise.

Proof: We note first that for any such pair (i,x)(i, x), we have i(x+1)nixn=0\lfloor \frac{i(x+1)}{n} \rfloor - \lfloor \frac{ix}{n} \rfloor = 0 or 11, since 0i(x+1)nixn=in10 \le \frac{i(x+1)}{n} - \frac{ix}{n} = \frac{i}{n} \le 1 holds. Now we have card numbered xx is turned over at the operation ii
    there exists a non-negative integer j satisfying nji=x \iff \text{there exists a non-negative integer } j \text{ satisfying } \lfloor \frac{nj}{i} \rfloor = x
    there exist a non-negative integer j satisfying xnji<x+1 \iff \text{there exist a non-negative integer } j \text{ satisfying } x \le \frac{nj}{i} < x+1
    there exists a non-negative integer j satisfying ixnj<i(x+1)n. \iff \text{there exists a non-negative integer } j \text{ satisfying } \frac{ix}{n} \le j < \frac{i(x+1)}{n}.
Note that the last statement is equivalent to i(x+1)nixn>0\lfloor \frac{i(x+1)}{n} \rfloor - \lfloor \frac{ix}{n} \rfloor > 0, and therefore, this completes the proof of Lemma 1 in view of the opening remark for the proof.

For each integer ii, 1in11 \le i \le n-1, let us say that the operations {i,ni}\{i, n-i\} are performed if the operation ii and operation nin-i are applied consecutively.

Lemma 2. The following assertion is valid:

The card numbered xx is turned over once during the operations {i,ni}\{i, n-i\} \leftrightarrow neither i(x+1)n\frac{i(x+1)}{n} nor ixn\frac{ix}{n} is an integer.

Proof: First note that the following holds in general for any pair of real numbers rr and ss for which r+sr+s is an integer:
[r]+[s]={r+s(r is an integer),r+s+1(r is not an integer). [r] + [s] = \begin{cases} r+s & (r \text{ is an integer}), \\ r+s+1 & (r \text{ is not an integer}). \end{cases}
From Lemma 1 it follows that
The card numbered xx is turned over once during the operations {i,ni}\{i, n-i\}
(i(x+1)nixn)+((ni)(x+1)n(ni)xn)=1 \leftrightarrow \left( \left\lfloor \frac{i(x+1)}{n} \right\rfloor - \left\lfloor \frac{ix}{n} \right\rfloor \right) + \left( \left\lfloor \frac{(n-i)(x+1)}{n} \right\rfloor - \left\lfloor \frac{(n-i)x}{n} \right\rfloor \right) = 1
(i(x+1)n+(ni)(x+1)n)(ixn+(ni)xn)=1() \leftrightarrow \left( \left\lfloor \frac{i(x+1)}{n} \right\rfloor + \left\lfloor \frac{(n-i)(x+1)}{n} \right\rfloor \right) - \left( \left\lfloor \frac{ix}{n} \right\rfloor + \left\lfloor \frac{(n-i)x}{n} \right\rfloor \right) = 1 \cdots (\dagger)
From the remark made above, we have
i(x+1)n+(ni)(x+1)n={x+1(i(x+1)n) is an integerx+2(i(x+1)n) is not an integer \left\lfloor \frac{i(x+1)}{n} \right\rfloor + \left\lfloor \frac{(n-i)(x+1)}{n} \right\rfloor = \begin{cases} x+1 & \left( \frac{i(x+1)}{n} \right) \text{ is an integer} \\ x+2 & \left( \frac{i(x+1)}{n} \right) \text{ is not an integer} \end{cases}
and also
ixn+(ni)xn={x(ixn) is an integerx+1(ixn) is not an integer. \left\lfloor \frac{ix}{n} \right\rfloor + \left\lfloor \frac{(n-i)x}{n} \right\rfloor = \begin{cases} x & \left( \frac{ix}{n} \right) \text{ is an integer} \\ x+1 & \left( \frac{ix}{n} \right) \text{ is not an integer}. \end{cases}
Therefore, we can conclude that
(\dagger) holds \leftrightarrow either both i(x+1)n\frac{i(x+1)}{n} and ixn\frac{ix}{n} are integers, or neither is an integer.
But since i(x+1)nixn=in\frac{i(x+1)}{n} - \frac{ix}{n} = \frac{i}{n} is not an integer, it is impossible to have both i(x+1)n\frac{i(x+1)}{n} and ixn\frac{ix}{n} to be integers simultaneously. This proves the assertion of the Lemma.

Now, since we have
ixn is an integerx is a multiple of ngcd(i,n) \frac{ix}{n} \text{ is an integer} \leftrightarrow x \text{ is a multiple of } \frac{n}{\text{gcd}(i, n)}
where gcd(i,n)\text{gcd}(i, n) denotes the greatest common divisor of ii and nn, we now have the following assertion:
During the operations {i,ni}\{i, n-i\} the card numbered xx is turned over once
 neither x nor x+1 is a multiple of ngcd(i,n)() \leftrightarrow \text{ neither } x \text{ nor } x+1 \text{ is a multiple of } \frac{n}{\text{gcd}(i, n)} \cdots \cdots (\dagger\dagger)

Next, we note that the result of applying each of the operations 1,2,,20131, 2, \ldots, 2013 once and only once the end result does not depend on the order these operations are applied. Therefore, in order to get the answer to the question of the problem, we may assume we apply operations {1,2012}\{1, 2012\}, {2,2011}\{2, 2011\}, \ldots, {1006,1007}\{1006, 1007\} and the operation 20132013 in any order.

From 2013=311612013 = 3 \cdot 11 \cdot 61, we see that there are
(31)(111)(611)=1200 i’s, satisfying gcd(i,2013)=1. (3-1)(11-1)(61-1) = 1200 \text{ i's, satisfying } \gcd(i, 2013) = 1.
(111)(611)=600 i’s, satisfying gcd(i,2013)=3. (11-1)(61-1) = 600 \text{ i's, satisfying } \gcd(i, 2013) = 3.
(31)(611)=120 i’s, satisfying gcd(i,2013)=11. (3-1)(61-1) = 120 \text{ i's, satisfying } \gcd(i, 2013) = 11.
(31)(111)=20 i’s, satisfying gcd(i,2013)=61. (3-1)(11-1) = 20 \text{ i's, satisfying } \gcd(i, 2013) = 61.
611=60 i’s, satisfying gcd(i,2013)=311. 61-1=60 \text{ i's, satisfying } \gcd(i, 2013) = 3 \cdot 11.
111=10 i’s, satisfying gcd(i,2013)=361. 11-1=10 \text{ i's, satisfying } \gcd(i, 2013) = 3 \cdot 61.
31=2 i’s, satisfying gcd(i,2013)=1161. 3-1=2 \text{ i's, satisfying } \gcd(i, 2013) = 11 \cdot 61.
Since we have gcd(i,2013)=gcd(2013i,2013)\gcd(i, 2013) = \gcd(2013 - i, 2013), among i=1,2,,1006i = 1, 2, \dots, 1006 there are precisely half, namely, 600600, 300300, 6060, 210210, 3030, 55, 11 i's satisfying the corresponding conditions on gcd(i,2013)\gcd(i, 2013) stated above. In particular, for i=1,2,,1006i = 1, 2, \dots, 1006 there are odd numbers of i's for which gcd(i,2013)=361\gcd(i, 2013) = 3 \cdot 61 or 116111 \cdot 61 and there are even number of i's for which gcd(i,2013)\gcd(i, 2013) takes other values. According to the statement ()(\dagger\dagger) if we apply the operations {i,2013i}\{i, 2013 - i\} for even number of i's for which gcd(i,2013)\gcd(i, 2013) take the same value, the face-side-arrangement of the cards remain the same. Consequently, it is enough to consider the result of applying each of the following operations once.

(a) Operations {i,2013i}\{i, 2013 - i\} for each ii for which gcd(i,2013)=361\gcd(i, 2013) = 3 \cdot 61,
(b) Operations {i,2013,i}\{i, 2013, i\} for each ii for which gcd(i,2013)=1161\gcd(i, 2013) = 11 \cdot 61,
(c) Operation 20132013.

Because of the statement ()(\dagger\dagger), after the application of the type (a) above, those cards having numbers which have remainder 1,2,,91, 2, \ldots, 9 after the division by 1111 change their sides. After the application of the type (b) above, those cards having numbers which have remainder 11 after division by 33 also changes their sides. Consequently, by the Chinese Remainder Theorem, we obtain the fact that the number of cards with their side with their number facing down (i.e., the face-side state is the same as in the initial state) after the applications of the types (a) and (b) is given by (9×1+(119)×(31))×61=793(9 \times 1 + (11-9) \times (3-1)) \times 61 = 793. With the operation of the type (c) all of the cards will be turned over, and therefore, the number of cards which show their side with their number facing up after the application of all the operations i,1i2013i, 1 \le i \le 2013, is 793793.

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.