Maths Olympiad Prep

Library / /18 of 63

, 2024

Combinatorics Difficulty 7.9 National olympiad, round 2 Prove it Turkey

If SS is a set consisting of 1212 positive integers, then what is the maximum number of pairs (a,b)(a, b) such that a,bSa, b \in S and ba\frac{b}{a} is a prime number?

Solutions — 2

Solution 1

Answer: 2020.

Example: S={1,2,3,5,6,7,10,14,15,21,30,42}S = \{1, 2, 3, 5, 6, 7, 10, 14, 15, 21, 30, 42\}.

Construct a graph GG whose vertex set is SS and edge set consists of noble pairs. We will show that E(G)=e20|E(G)| = e \le 20.

We first prove that GG is bipartite. Assume that GG has an odd cycle. Start from one of the vertices and move along the cycle in clockwise direction. For any prime number pp as we pass through an edge we either multiply the number by pp, divide the number by pp or do an operation with some other prime. As we come back to the starting point, number of multiplications by pp must be equal to the number of divisions by pp. Therefore, contribution of any prime pp to the cycle is even, and hence the cycle must be an even cycle, contradiction.

Let parts of GG be AA and BB with A=a|A| = a, B=b|B| = b, aba \le b. Now consider a K2,2K_{2,2} in GG with vertices a1,a2Aa_1, a_2 \in A and b1,b2Bb_1, b_2 \in B. It is easy to see that {a1,a2}={n,npq}\{a_1, a_2\} = \{n, npq\} and {b1,b2}={np,nq}\{b_1, b_2\} = \{np, nq\} (or vice versa) for some positive integer nn and distinct primes pp and qq. Also note that we have a1a2=b1b2a_1 a_2 = b_1 b_2.

Suppose that a K2,3K_{2,3} exists in GG with vertices a1,a2Aa_1, a_2 \in A and b1,b2,b3Bb_1, b_2, b_3 \in B. Then a1a2=b1b2=b1b3a_1 a_2 = b_1 b_2 = b_1 b_3 which implies that b1=b3b_1 = b_3, contradiction. Thus GG has no K2,3K_{2,3}. Consequently, sum of degrees of any two vertices in AA is at most b+2b+2, and hence, we get ea(b+2)/2e \le a(b+2)/2. Then, when a=1,2,3,4a = 1,2,3,4 we get e20e \le 20.

Case 1: a=5a = 5 and b=7b = 7. Let mm be the largest degree in AA. If m=7m = 7, then e7+42=15e \le 7 + 4 \cdot 2 = 15. If m=6m = 6, then e6+43=18e \le 6 + 4 \cdot 3 = 18. If m=5m = 5, then the other degrees are at most 44 and hence e5+44=21e \le 5 + 4 \cdot 4 = 21 and e=21e = 21 holds only if the remaining four vertices all have degree 44.

Let B={b1,,b7}B = \{b_1, \dots, b_7\} and suppose that b1,,b5b_1, \dots, b_5 are adjacent to a vertex in AA. Then, as GG has no K2,3K_{2,3}, any vertex in AA of degree 44 must be adjacent to both of b6b_6 and b7b_7. But then there occurs to be a K2,3K_{2,3}, contradiction. Thus, we have e20e \le 20. Finally, if m4m \le 4, then obviously e20e \le 20.

Case 2: a=b=6a = b = 6. If m=6m = 6, then e6+52=16e \le 6 + 5 \cdot 2 = 16. If m=5m = 5, then e5+53=20e \le 5 + 5 \cdot 3 = 20. If m3m \le 3, then clearly e18e \le 18. Finally, let us consider the case when m=4m = 4. We will show that AA can not have three vertices of degree 44. Assume a1,a2,a3Aa_1, a_2, a_3 \in A all have degree 44. Let the neighbors of a1a_1 be b1,b2,b3,b4b_1, b_2, b_3, b_4. Since GG has no K2,3K_{2,3}, a2a_2 is adjacent to b5b_5 and b6b_6. Let the other two neighbors of a2a_2 be b3b_3 and b4b_4. Again as GG has no K2,3K_{2,3}, we easily see that neighbors of a3a_3 are b1,b2,b5,b6b_1, b_2, b_5, b_6. Note that a1,a2,a3a_1, a_2, a_3 do not have a common neighbor and any two of them belong to some K2,2K_{2,2}. Suppose a1<a2<a3a_1 < a_2 < a_3. The ratio a1/aja_1/a_j where 1j<i31 \le j < i \le 3 is either product or quotient of two distinct primes. As a3/a1=(a3/a2)(a2/a1)a_3/a_1 = (a_3/a_2) \cdot (a_2/a_1), we obtain that {a1,a2,a3}={np,nq,nr}\{a_1, a_2, a_3\} = \{np, nq, nr\} or {n,npq,npr}\{n, npq, npr\} for some positive integer nn and distinct primes p,q,rp, q, r. But then a1,a2,a3a_1, a_2, a_3 are all adjacent to nn or npnp, contradiction.

Solution 2

Let f(n)f(n) be the maximum number of such pairs in a set with nn positive integers. We will show that f(12)20f(12) \le 20. By the example in the first solution, then we can conclude that f(12)=20f(12) = 20.

Note that we can assume that the greatest common divisor of all the numbers in the set is 11. Let a/b=pa/b = p be a prime and aa and bb be from the set. Divide the set into two sets, AA consisting of the ones not divisible by pp, and BB consisting of the ones divisible by pp. Let x/y=qx/y = q be a prime number. Then we can not have xAx \in A and yBy \in B. Also note that xBx \in B and yAy \in A implies q=pq = p and there exists a unique xx for given yy and vice versa. Therefore, we obtain the following inequality
f(n)max1kn1{f(k)+f(nk)+min(k,nk)}. f(n) \le \max_{1 \le k \le n-1} \{f(k) + f(n-k) + \min(k, n-k)\}.

Clearly f(1)=0f(1) = 0 and f(2)=1f(2) = 1. By using that inequality one can easily obtain f(12)20f(12) \le 20 as desired.

*Remark:* By using the inequality above one can determine the exact value of f(n)f(n). Let g(k)g(k) be the number of ones in the binary representation of kk. Then
f(n)=k=0n1g(k). f(n) = \sum_{k=0}^{n-1} g(k).
And the example is as follows: Suppose that n1n-1 has mm digits in its binary representation. Let p1,p2,,pmp_1, p_2, \dots, p_m be distinct prime numbers. By adding zeros to the left extend binary representations of 0,1,,n20, 1, \dots, n-2 to be with mm digits. Then for any 0kn10 \le k \le n-1, if its binary representation is a1a2ama_1 a_2 \dots a_m pick the number i=1mpiai\prod_{i=1}^m p_i^{a'_i} for the set. One can easily see that number of pairs whose quotient is prime is exactly k=0n1g(k)\sum_{k=0}^{n-1} g(k).

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.