Olympiad Maths Prep

Library / /20 of 21

, 2007

Combinatorics Difficulty 9.1 IMO level Prove it IMO

Find all positive integers nn, for which the numbers in the set S={1,2,,n}S=\{1,2, \ldots, n\} can be colored red and blue, with the following condition being satisfied: the set S×S×SS \times S \times S contains exactly 20072007 ordered triples (x,y,z)(x, y, z) such that (i) x,y,zx, y, z are of the same color and (ii) x+y+zx+y+z is divisible by nn.

Solution

Suppose that the numbers 1,2,,n1,2, \ldots, n are colored red and blue. Denote by RR and BB the sets of red and blue numbers, respectively; let R=r|R|=r and B=b=nr|B|=b=n-r. Call a triple (x,y,z)S×S×S(x, y, z) \in S \times S \times S monochromatic if x,y,zx, y, z have the same color, and bichromatic otherwise. Call a triple (x,y,z)(x, y, z) divisible if x+y+zx+y+z is divisible by nn. We claim that there are exactly r2rb+b2r^{2}-r b+b^{2} divisible monochromatic triples.

For any pair (x,y)S×S(x, y) \in S \times S there exists a unique zx,ySz_{x, y} \in S such that the triple (x,y,zx,y)(x, y, z_{x, y}) is divisible; so there are exactly n2n^{2} divisible triples. Furthermore, if a divisible triple (x,y,z)(x, y, z) is bichromatic, then among x,y,zx, y, z there are either one blue and two red numbers, or vice versa. In both cases, exactly one of the pairs (x,y),(y,z)(x, y),(y, z) and (z,x)(z, x) belongs to the set R×BR \times B. Assign such pair to the triple (x,y,z)(x, y, z).

Conversely, consider any pair (x,y)R×B(x, y) \in R \times B, and denote z=zx,yz=z_{x, y}. Since xyx \neq y, the triples (x,y,z),(y,z,x)(x, y, z),(y, z, x) and (z,x,y)(z, x, y) are distinct, and (x,y)(x, y) is assigned to each of them. On the other hand, if (x,y)(x, y) is assigned to some triple, then this triple is clearly one of those mentioned above. So each pair in R×BR \times B is assigned exactly three times.

Thus, the number of bichromatic divisible triples is three times the number of elements in R×BR \times B, and the number of monochromatic ones is n23rb=(r+b)23rb=r2rb+b2n^{2}-3 r b=(r+b)^{2}-3 r b=r^{2}-r b+b^{2}, as claimed.

So, to find all values of nn for which the desired coloring is possible, we have to find all nn, for which there exists a decomposition n=r+bn=r+b with r2rb+b2=2007r^{2}-r b+b^{2}=2007. Therefore, 9r2rb+b2=(r+b)23rb9 \mid r^{2}-r b+b^{2}=(r+b)^{2}-3 r b. From this it consequently follows that 3r+b,3rb3|r+b, 3| r b, and then 3r,3b3|r, 3| b. Set r=3s,b=3cr=3 s, b=3 c. We can assume that scs \geq c. We have s2sc+c2=223s^{2}-s c+c^{2}=223.

Furthermore,
892=4(s2sc+c2)=(2cs)2+3s23s23s23c(sc)=3(s2sc+c2)=669 892=4\left(s^{2}-s c+c^{2}\right)=(2 c-s)^{2}+3 s^{2} \geq 3 s^{2} \geq 3 s^{2}-3 c(s-c)=3\left(s^{2}-s c+c^{2}\right)=669
so 297s2223297 \geq s^{2} \geq 223 and 17s1517 \geq s \geq 15. If s=15s=15 then
c(15c)=c(sc)=s2(s2sc+c2)=152223=2 c(15-c)=c(s-c)=s^{2}-\left(s^{2}-s c+c^{2}\right)=15^{2}-223=2
which is impossible for an integer cc. In a similar way, if s=16s=16 then c(16c)=33c(16-c)=33, which is also impossible. Finally, if s=17s=17 then c(17c)=66c(17-c)=66, and the solutions are c=6c=6 and c=11c=11. Hence, (r,b)=(51,18)(r, b)=(51,18) or (r,b)=(51,33)(r, b)=(51,33), and the possible values of nn are n=51+18=69n=51+18=69 and n=51+33=84n=51+33=84.

Looking for a route rather than 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.