Number theoryDifficulty 7.5National olympiad, round 2Prove itJapan
There are 2013 cards numbered 0, 1, 2, …, 2012. Initially, all the cards are placed with the face with a written number down. Then, we perform for each i=1,2,…,2013 the following operation i starting with i=1 and with increasing order ending up with i=2013:
Operation i: Flip each of the i cards having the number ⌊i2013j⌋ for j=0,1,…,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] for each real number r the greatest integer less than or equal to r.
Solution
Let n=2013 throughout the subsequent discussion on this problem. For any real number r denote by ⌊r⌋ the smallest integer greater than or equal to r. In order to obtain the desired solution, we prove the following two lemmas.
Lemma 1. For 1≤i≤n and 0≤x≤n−1, we have ⌊ni(x+1)⌋−⌊nix⌋=1 holds if the card with number x is turned over at the operation i, and ⌊ni(x+1)⌋−⌊nix⌋=0, otherwise.
Proof: We note first that for any such pair (i,x), we have ⌊ni(x+1)⌋−⌊nix⌋=0 or 1, since 0≤ni(x+1)−nix=ni≤1 holds. Now we have card numbered x is turned over at the operation i ⟺there exists a non-negative integer j satisfying ⌊inj⌋=x ⟺there exist a non-negative integer j satisfying x≤inj<x+1 ⟺there exists a non-negative integer j satisfying nix≤j<ni(x+1). Note that the last statement is equivalent to ⌊ni(x+1)⌋−⌊nix⌋>0, and therefore, this completes the proof of Lemma 1 in view of the opening remark for the proof.
For each integer i, 1≤i≤n−1, let us say that the operations {i,n−i} are performed if the operation i and operation n−i are applied consecutively.
Lemma 2. The following assertion is valid:
The card numbered x is turned over once during the operations {i,n−i}↔ neither ni(x+1) nor nix is an integer.
Proof: First note that the following holds in general for any pair of real numbers r and s for which r+s is an integer: [r]+[s]={r+sr+s+1(r is an integer),(r is not an integer). From Lemma 1 it follows that The card numbered x is turned over once during the operations {i,n−i} ↔(⌊ni(x+1)⌋−⌊nix⌋)+(⌊n(n−i)(x+1)⌋−⌊n(n−i)x⌋)=1 ↔(⌊ni(x+1)⌋+⌊n(n−i)(x+1)⌋)−(⌊nix⌋+⌊n(n−i)x⌋)=1⋯(†) From the remark made above, we have ⌊ni(x+1)⌋+⌊n(n−i)(x+1)⌋=⎩⎨⎧x+1x+2(ni(x+1)) is an integer(ni(x+1)) is not an integer and also ⌊nix⌋+⌊n(n−i)x⌋={xx+1(nix) is an integer(nix) is not an integer. Therefore, we can conclude that (†) holds ↔ either both ni(x+1) and nix are integers, or neither is an integer. But since ni(x+1)−nix=ni is not an integer, it is impossible to have both ni(x+1) and nix to be integers simultaneously. This proves the assertion of the Lemma.
Now, since we have nix is an integer↔x is a multiple of gcd(i,n)n where gcd(i,n) denotes the greatest common divisor of i and n, we now have the following assertion: During the operations {i,n−i} the card numbered x is turned over once ↔ neither x nor x+1 is a multiple of gcd(i,n)n⋯⋯(††)
Next, we note that the result of applying each of the operations 1,2,…,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}, {2,2011}, …, {1006,1007} and the operation 2013 in any order.
From 2013=3⋅11⋅61, we see that there are (3−1)(11−1)(61−1)=1200 i’s, satisfying gcd(i,2013)=1. (11−1)(61−1)=600 i’s, satisfying gcd(i,2013)=3. (3−1)(61−1)=120 i’s, satisfying gcd(i,2013)=11. (3−1)(11−1)=20 i’s, satisfying gcd(i,2013)=61. 61−1=60 i’s, satisfying gcd(i,2013)=3⋅11. 11−1=10 i’s, satisfying gcd(i,2013)=3⋅61. 3−1=2 i’s, satisfying gcd(i,2013)=11⋅61. Since we have gcd(i,2013)=gcd(2013−i,2013), among i=1,2,…,1006 there are precisely half, namely, 600, 300, 60, 210, 30, 5, 1 i's satisfying the corresponding conditions on gcd(i,2013) stated above. In particular, for i=1,2,…,1006 there are odd numbers of i's for which gcd(i,2013)=3⋅61 or 11⋅61 and there are even number of i's for which gcd(i,2013) takes other values. According to the statement (††) if we apply the operations {i,2013−i} for even number of i's for which 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,2013−i} for each i for which gcd(i,2013)=3⋅61, (b) Operations {i,2013,i} for each i for which gcd(i,2013)=11⋅61, (c) Operation 2013.
Because of the statement (††), after the application of the type (a) above, those cards having numbers which have remainder 1,2,…,9 after the division by 11 change their sides. After the application of the type (b) above, those cards having numbers which have remainder 1 after division by 3 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+(11−9)×(3−1))×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,1≤i≤2013, is 793.
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.