Maths Olympiad Prep

Library / Czech and Slovak Mathematical Olympiad /47 of 70

Czech and Slovak Mathematical Olympiad

Combinatorics Difficulty 6.4 National Olympiad Prove it Czech Republic

Find the smallest positive integer nn such that for any coloring of numbers 1,2,3,…,n1, 2, 3, \ldots, n by three colors there exist two numbers with the same color whose difference is a square of an integer. (Vojtech Bálint, Michal Rolínek, Josef Tkadlec)

Solution

The answer is n=29n = 29.

First, for the sake of contradiction, assume that numbers 1,2,…,291, 2, \ldots, 29 can be colored by colors A,B,CA, B, C such that no two numbers with the same color differ by a square. Let f(i)f(i) be the color of number ii for i∈{1,2,…,29}i \in \{1, 2, \ldots, 29\}.

Since 9,169, 16, and 2525 are squares, numbers 1,10,261, 10, 26 are all assigned distinct colors. The same is true for numbers 1,17,261, 17, 26, hence 1010 and 1717 are assigned the same color. Likewise we get f(11)=f(18)f(11) = f(18), f(12)=f(19)f(12) = f(19) and f(13)=f(20)f(13) = f(20) (for the last equality we look at numbers 4,13,20,294, 13, 20, 29).

Without loss of generality, assume f(10)=f(17)=Af(10) = f(17) = A. As 11=10+1211 = 10 + 1^2, we have f(11)≠f(10)f(11) \neq f(10). Without loss of generality, let f(11)=f(18)=Bf(11) = f(18) = B. Now 19=18+12=10+3219 = 18 + 1^2 = 10 + 3^2, hence f(12)=f(19)=Cf(12) = f(19) = C. Similarly, 20=19+12=11+3220 = 19 + 1^2 = 11 + 3^2 implies f(13)=f(20)=Af(13) = f(20) = A. We have derived f(13)=A=f(17)f(13) = A = f(17), a contradiction.

On the other hand, if n≤28n \le 28, we may color the numbers as below. It's easy to check that no two numbers with the same color differ by a square of an integer.

Figure 1

Fig. 4

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

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