Maths Olympiad Prep

Library / Baltic Way competition problems /27 of 45

Baltic Way competition problems

Combinatorics Difficulty 6.0 National Olympiad Prove it Baltic Way

Let n≥4n \ge 4 be an even integer. In how many ways can one select four different positive integers kk, 1≤k≤n1 \le k \le n, so that the sum of two of the chosen numbers equals the sum of the other two?

Solution

Answer:
(n−2)(2n2−5n)24 \frac{(n-2)(2n^2 - 5n)}{24}

Solution:
Letting aa be the smallest and bb the largest of the chosen numbers, the sum in the problem has to be a+ba+b. So given aa and bb, the other numbers cc and dd have to satisfy a<c,d<ba < c, d < b and c+d=a+bc+d = a+b. For the smaller of c,dc, d, say cc, one can take any number larger than aa but smaller than the average of aa and bb, and the choice cc uniquely determines dd. So if b−a=2p+1b-a = 2p+1 or b−a=2p+2b-a = 2p+2, there are pp possible choices of cc. Assume n=2mn=2m. Then the largest possible b−a=2m−1=2(m−1)+1b-a = 2m-1 = 2(m-1)+1, and there is just one possible pair (a,b)=(1,2m)=(1,n)(a, b) = (1, 2m) = (1, n). For b−a=n−qb-a = n-q there are qq possible pairs (a,b)(a, b). The pp possible choices of cc thus appear when q=n−2p−2q = n-2p-2 and q=n−2p−1q = n-2p-1, or altogether in 2n−4p−32n-4p-3 cases. So the total number of choices is
∑p=1m−2(2n−4p−3)p+m−1=(2n−3)∑p=1m−2p−4∑p=1m−2p2+m−1=12(2n−3)(m−2)(m−1)−46(m−2)(m−1)(2m−3)+(m−1). \begin{aligned} \sum_{p=1}^{m-2} (2n - 4p - 3)p + m - 1 &= (2n - 3) \sum_{p=1}^{m-2} p - 4 \sum_{p=1}^{m-2} p^2 + m - 1 \\ &= \frac{1}{2}(2n - 3)(m - 2)(m - 1) - \frac{4}{6}(m - 2)(m - 1)(2m - 3) + (m - 1). \end{aligned}
Using 2m=n2m=n, the last sum is easily simplified into
(n−2)(2n2−5n)24 \frac{(n-2)(2n^2 - 5n)}{24}
The restriction "n even" can be removed, but then there are two essentially similar but slightly different sums to be done. "n odd" would be infinitesimally easier, because there would not be the single last term.

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.