Maths Olympiad Prep

Library / /3 of 5

Number theory Difficulty 7.7 National olympiad, round 2 Prove it Romania

Consider an odd prime pp and a positive integer N<50pN < 50p. Let a1,a2,,aNa_1, a_2, \dots, a_N be a list of positive integers less than pp such that any specific value occurs at most 51100N\frac{51}{100}N times and a1+a2++aNa_1 + a_2 + \dots + a_N is not divisible by pp. Prove that there exists a permutation b1,b2,,bNb_1, b_2, \dots, b_N of the aia_i such that, for all k=1,2,,Nk = 1, 2, \dots, N, the sum b1+b2++bkb_1 + b_2 + \dots + b_k is not divisible by pp.

Solution

Lemma. Let nn be a positive integer and let c1,c2,,cnc_1, c_2, \dots, c_n be a list of positive integers less than pp such that each specific value occurs at most 12(n+1)\frac{1}{2}(n+1) times. Fix a residue rc1+c2++cn(modp)r \neq c_1 + c_2 + \dots + c_n \pmod{p}. Then there exists a permutation d1,d2,,dnd_1, d_2, \dots, d_n of the cic_i such that rd1+d2++dk(modp)r \neq d_1 + d_2 + \dots + d_k \pmod{p} for all k=1,2,,nk = 1, 2, \dots, n.
Proof. Induct on nn. The base case, n=1n=1, is clear, so let n2n \ge 2. Consider the residue aa that occurs the most times amongst the cic_i.

If a≢r(modp)a \not\equiv r \pmod{p}, set d1=ad_1 = a and complete the rest of the list using the inductive hypothesis with rr replaced by rar-a, as any residue will occur amongst the remaining cic_i at most 12((n1)+1)\frac{1}{2}((n-1)+1) times. Indeed, if no other residue occurs as many times as aa, then the number of occurrences of any residue amongst the remaining cic_i is at most 12(n+1)1=12(n1)<12((n1)+1)\frac{1}{2}(n+1)-1 = \frac{1}{2}(n-1) < \frac{1}{2}((n-1)+1). Otherwise, if there is another residue that occurs as many times as aa, their number of occurrences has to be at most 12n=12((n1)+1)\frac{1}{2}n = \frac{1}{2}((n-1)+1).

If ar(modp)a \equiv r \pmod{p}, choose a residue b≢a(modp)b \not\equiv a \pmod{p} amongst the cic_i; the choice is possible, as 12(n+1)<n\frac{1}{2}(n+1) < n. Set d1=bd_1 = b and d2=ad_2 = a, noting that d1+d2=b+ar+b≢r(modp)d_1 + d_2 = b + a \equiv r + b \not\equiv r \pmod{p}. If no other residue occurs as many times as aa, then each residue occurs amongst the remaining cic_i at most 12(n+1)1=12(n1)=12((n2)+1)\frac{1}{2}(n+1)-1 = \frac{1}{2}(n-1) = \frac{1}{2}((n-2)+1) times. If aa occurs at most 12(n1)\frac{1}{2}(n-1) times, then clearly the same will hold for any residue in the remaining cic_i. The remaining possibility is that aa and another residue both occur 12n\frac{1}{2}n times and nn is even, meaning that the other residue has to be bb, and there are no other residues; it is clear that the occurrences in the remaining cic_i are precisely 12(n2)<12((n2)+1)\frac{1}{2}(n-2) < \frac{1}{2}((n-2)+1). The inductive hypothesis then applies with rr replaced by b-b to complete the list. This establishes the lemma.

Back to the problem, if each residue occurs at most 12(N+1)\frac{1}{2}(N+1) times, the conclusion follows by the Lemma.

Otherwise, there is exactly one residue aa that occurs M>12(N+1)M > \frac{1}{2}(N+1) times amongst the aia_i. Note that 2MN>(N+1)N=12M - N > (N+1) - N = 1, to set bi=ab_i = a, i=1,2,,2MNi = 1, 2, \dots, 2M - N. Letting α=50\alpha = 50, note also that 2MN2α+12αNN=1αN<p2M - N \le 2 \cdot \frac{\alpha+1}{2\alpha}N - N = \frac{1}{\alpha}N < p, so none of the first 2MN2M - N partial sums is divisible by pp, as pp is prime.

To complete the proof, apply the Lemma with r=(N2M)ar = (N-2M)a to the remaining aia_i. There are left N(2MN)=2(NM)N - (2M - N) = 2(N - M) such, aa occurs M(2MN)=NMM - (2M - N) = N - M times amongst these and any other residue occurs at most NMN - M times, both of which do not exceed 12(2(NM)+1)\frac{1}{2}(2(N - M) + 1).

*Alternative solution.* The permutation will be constructed step by step, first choosing b1b_1, then b2b_2, and so on. At every step, sort the remaining values by their number of appearances from most frequent to least frequent, and from largest to smallest for the situations where the number of appearances is the same. After that, attempt to select the first value from the sorted list; if this results in a partial sum that is divisible by pp, then attempt to select the second value from the list, which will result in a partial sum that is not divisible by pp as the first and second values are different modulo pp. Label the step as type (I) if the first value has been selected and as type (II) if the second value has been selected.

Lemma. Any step of type (II) is followed by a step of type (I).

Proof. Suppose that step jj is of type (II). Denote the first two values according to the sorting order with aa and bb, and let ss be the partial sum until this step. Since step jj is type (II), s+a0(modp)s + a \equiv 0 \pmod{p}. At step j+1j + 1, the first value according to the sorting order will still be aa. Since s+b+a≢0(modp)s + b + a \not\equiv 0 \pmod{p}, aa can be selected for step j+1j + 1, so step j+1j + 1 is of type (I).

Now suppose, for the sake of contradiction, that this procedure fails. Let k+1<Nk+1 < N be the first step when neither (I) nor (II) is possible. In particular, this means that there is a single value aa remaining, and it occurs NkN - k times. Let jj be the smallest number with the following property: at every step between jj and k+1k + 1, the value aa is the first one according to the sorting order; in particular, aa is the most frequently occurring one. Such a jj exists because k+1k + 1 satisfies this property.

If j>1j > 1, then at step j1j-1 there is another value bb that comes before aa in the sorted order. Suppose that at step j1j-1 there are qq values of aa remaining; then there are at least qq values of bb remaining. According to the lemma, at least half of the steps j,j+1,,kj, j+1, \dots, k are of type (I), which means that aa is selected in them. Denote =kj+1\ell = k-j+1, then aa has been selected at least /2\lfloor \ell/2 \rfloor steps between jj and kk. Since at step k+1k+1, there are Nk2N-k \ge 2 values of aa remaining, it means that q/2+2q \ge \lfloor \ell/2 \rfloor + 2. At the same time, at step k+1k+1 there are no values of bb remaining, so between steps jj and kk all the remaining bb values have been selected, and this can happen at most /2\ell - \lfloor \ell/2 \rfloor times. Combining these two leads to /2q/2+2\ell - \lfloor \ell/2 \rfloor \ge q \ge \lfloor \ell/2 \rfloor + 2, or 2/2+2\ell \ge 2\lfloor \ell/2 \rfloor + 2, a contradiction.

If j=1j = 1, then aa is always the first in the sorted order. Therefore, the first p1p-1 steps are of type (I), and step pp is of type (II). If kpk \ge p, from steps p+1p+1 to kk, at least every other step is of type (I), meaning that aa is selected. Once step kk is done, there are NkN-k remaining values of aa. Therefore, in the beginning, there were at least
(p1)+kp2+Nk=Nk2+p21>NN22+N2α1=α+12αN (p-1) + \frac{k-p}{2} + N-k = N - \frac{k}{2} + \frac{p}{2} - 1 > N - \frac{N-2}{2} + \frac{N}{2\alpha} - 1 = \frac{\alpha+1}{2\alpha}N
values of aa, contradiction. In the situation when k<pk < p, there are at least N1N - 1 values of aa, which is also a contradiction.

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.