Maths Olympiad Prep

Track / Stage 7 / 127 of 300 #2007 of 2444

Problem 2007

National Olympiad second round; IMO P1/P4
Number theory Difficulty 7.4 Prove it Indian National Mathematical Olympiad · India

Let SS be a finite set of positive integers. Assume that there are precisely 2023 ordered pairs (x,y)(x, y) in S×SS \times S so that the product xyxy is a perfect square. Prove that one can find at least four distinct elements in SS so that none of their pairwise products is a perfect square.

Note: As an example, if S={1,2,4}S = \{1, 2, 4\}, there are exactly five such ordered pairs: (1,1)(1, 1), (1,4)(1, 4), (2,2)(2, 2), (4,1)(4, 1), and (4,4)(4, 4).

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Next problem →

Official solution

Let SS be a finite set of positive integers such that there are exactly 2023 ordered pairs (x,y)S×S(x, y) \in S \times S with xyxy a perfect square.

Let us analyze the structure of SS.

For any x,ySx, y \in S, xyxy is a perfect square if and only if the product of their squarefree parts is a square. For each xSx \in S, write x=dx2sxx = d_x^2 s_x, where sxs_x is squarefree. Then xyxy is a perfect square if and only if sxsys_x s_y is a square, i.e., sx=sys_x = s_y.

Thus, for each tt (squarefree), let St={xS:sx=t}S_t = \{x \in S : s_x = t\}. For xStx \in S_t and ySty \in S_t, xyxy is a perfect square. For xStx \in S_t, ySty \in S_{t'} with ttt \neq t', xyxy is not a perfect square.

Let ai=Stia_i = |S_{t_i}| for the distinct squarefree parts t1,,tkt_1, \dots, t_k that appear in SS. Then the total number of ordered pairs (x,y)(x, y) with xyxy a perfect square is i=1kai2=2023\sum_{i=1}^k a_i^2 = 2023.

We are to show that SS contains at least four distinct elements such that none of their pairwise products is a perfect square. That is, we need to find four elements with distinct squarefree parts.

Suppose, for contradiction, that there do not exist four such elements. Then the number of distinct squarefree parts k3k \leq 3.

Let us consider all possible values of kk.

Case 1: k=1k = 1.
Then SS consists of numbers with the same squarefree part, so a1=na_1 = n, n2=2023n^2 = 2023, but 20232023 is not a perfect square. Contradiction.

Case 2: k=2k = 2.
Then a1+a2=na_1 + a_2 = n, a12+a22=2023a_1^2 + a_2^2 = 2023.
Try all possible integer solutions:
Let a1=ma_1 = m, a2=nma_2 = n - m.
Then m2+(nm)2=2023m^2 + (n - m)^2 = 2023.
But m2+(nm)2=2m22nm+n2=2023m^2 + (n - m)^2 = 2m^2 - 2nm + n^2 = 2023.
But n=a1+a22023+2023<90n = a_1 + a_2 \leq \sqrt{2023} + \sqrt{2023} < 90.
Try small values:
Let a1=a2=ta_1 = a_2 = t, then 2t2=2023    t2=1011.52t^2 = 2023 \implies t^2 = 1011.5, not integer.
Try a1=ta_1 = t, a2=t+1a_2 = t+1:
t2+(t+1)2=2t2+2t+1=2023    2t2+2t2022=0    t2+t1011=0t^2 + (t+1)^2 = 2t^2 + 2t + 1 = 2023 \implies 2t^2 + 2t - 2022 = 0 \implies t^2 + t - 1011 = 0.
Discriminant: 1+4044=40451 + 4044 = 4045, not a perfect square.
Try a1=ta_1 = t, a2=t+2a_2 = t+2:
t2+(t+2)2=t2+t2+4t+4=2t2+4t+4=2023    2t2+4t2019=0t^2 + (t+2)^2 = t^2 + t^2 + 4t + 4 = 2t^2 + 4t + 4 = 2023 \implies 2t^2 + 4t - 2019 = 0.
t2+2t1009.5=0t^2 + 2t - 1009.5 = 0.
No integer solution.
Try a1=44a_1 = 44, a2=1a_2 = 1: 442+12=1936+1=193744^2 + 1^2 = 1936 + 1 = 1937.
Try a1=45a_1 = 45, a2=2a_2 = 2: 2025+4=20292025 + 4 = 2029.
Try a1=44a_1 = 44, a2=5a_2 = 5: 1936+25=19611936 + 25 = 1961.
Try a1=45a_1 = 45, a2=7a_2 = 7: 2025+49=20742025 + 49 = 2074.
Try a1=40a_1 = 40, a2=13a_2 = 13: 1600+169=17691600 + 169 = 1769.
Try a1=42a_1 = 42, a2=17a_2 = 17: 1764+289=20531764 + 289 = 2053.
Try a1=43a_1 = 43, a2=14a_2 = 14: 1849+196=20451849 + 196 = 2045.
Try a1=41a_1 = 41, a2=10a_2 = 10: 1681+100=17811681 + 100 = 1781.
Try a1=45a_1 = 45, a2=14a_2 = 14: 2025+196=22212025 + 196 = 2221.
So, no integer solution for k=2k = 2.

Case 3: k=3k = 3.
Let a1,a2,a31a_1, a_2, a_3 \geq 1, a12+a22+a32=2023a_1^2 + a_2^2 + a_3^2 = 2023.
Try a1=a2=a3=ta_1 = a_2 = a_3 = t, 3t2=2023    t2=674.333t^2 = 2023 \implies t^2 = 674.33.
Try a1=a2=ta_1 = a_2 = t, a3=t+1a_3 = t+1:
t2+t2+(t+1)2=3t2+2t+1=2023    3t2+2t2022=0t^2 + t^2 + (t+1)^2 = 3t^2 + 2t + 1 = 2023 \implies 3t^2 + 2t - 2022 = 0.
Discriminant: 4+3×2022×4=4+24264=242684 + 3 \times 2022 \times 4 = 4 + 24264 = 24268, not a perfect square.
Try a1=ta_1 = t, a2=t+1a_2 = t+1, a3=t+2a_3 = t+2:
t2+(t+1)2+(t+2)2=t2+t2+2t+1+t2+4t+4=3t2+6t+5=2023t^2 + (t+1)^2 + (t+2)^2 = t^2 + t^2 + 2t + 1 + t^2 + 4t + 4 = 3t^2 + 6t + 5 = 2023.
3t2+6t2018=03t^2 + 6t - 2018 = 0.
Discriminant: 36+3×2018×4=36+24216=2425236 + 3 \times 2018 \times 4 = 36 + 24216 = 24252, not a perfect square.
Try a1=44a_1 = 44, a2=44a_2 = 44, a3=5a_3 = 5: 1936+1936+25=38971936 + 1936 + 25 = 3897.
Try a1=44a_1 = 44, a2=43a_2 = 43, a3=2a_3 = 2: 1936+1849+4=37891936 + 1849 + 4 = 3789.
Try a1=45a_1 = 45, a2=1a_2 = 1, a3=1a_3 = 1: 2025+1+1=20272025 + 1 + 1 = 2027.
Try a1=44a_1 = 44, a2=5a_2 = 5, a3=2a_3 = 2: 1936+25+4=19651936 + 25 + 4 = 1965.
Try a1=45a_1 = 45, a2=7a_2 = 7, a3=1a_3 = 1: 2025+49+1=20752025 + 49 + 1 = 2075.
Try a1=42a_1 = 42, a2=17a_2 = 17, a3=2a_3 = 2: 1764+289+4=20571764 + 289 + 4 = 2057.
Try a1=43a_1 = 43, a2=14a_2 = 14, a3=2a_3 = 2: 1849+196+4=20491849 + 196 + 4 = 2049.
Try a1=41a_1 = 41, a2=10a_2 = 10, a3=2a_3 = 2: 1681+100+4=17851681 + 100 + 4 = 1785.
Try a1=44a_1 = 44, a2=44a_2 = 44, a3=1a_3 = 1: 1936+1936+1=38731936 + 1936 + 1 = 3873.
Try a1=44a_1 = 44, a2=43a_2 = 43, a3=1a_3 = 1: 1936+1849+1=37861936 + 1849 + 1 = 3786.
Try a1=45a_1 = 45, a2=1a_2 = 1, a3=2a_3 = 2: 2025+1+4=20302025 + 1 + 4 = 2030.
Try a1=44a_1 = 44, a2=5a_2 = 5, a3=1a_3 = 1: 1936+25+1=19621936 + 25 + 1 = 1962.
Try a1=45a_1 = 45, a2=7a_2 = 7, a3=2a_3 = 2: 2025+49+4=20782025 + 49 + 4 = 2078.
Try a1=42a_1 = 42, a2=17a_2 = 17, a3=1a_3 = 1: 1764+289+1=20541764 + 289 + 1 = 2054.
Try a1=43a_1 = 43, a2=14a_2 = 14, a3=1a_3 = 1: 1849+196+1=20461849 + 196 + 1 = 2046.
Try a1=41a_1 = 41, a2=10a_2 = 10, a3=1a_3 = 1: 1681+100+1=17821681 + 100 + 1 = 1782.

So, there is no solution for k=3k = 3 with positive integers a1,a2,a3a_1, a_2, a_3.

Therefore, the only possibility is k4k \geq 4.

Thus, there are at least four distinct squarefree parts among the elements of SS. Pick one element from each of four different StiS_{t_i}, say x1,x2,x3,x4x_1, x_2, x_3, x_4 with sxis_{x_i} all distinct. Then for any iji \neq j, xixjx_i x_j is not a perfect square, since sxisxjs_{x_i} \neq s_{x_j}.

Therefore, there exist at least four distinct elements in SS such that none of their pairwise products is a perfect square, as desired.

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