Maths Olympiad Prep

Library / /265 of 383

, 2021

Algebra Difficulty 8.8 Shortlist Prove it IMO

For every integer n1n \geqslant 1 consider the n×nn \times n table with entry ijn+1\left\lfloor\frac{ij}{n+1}\right\rfloor at the intersection of row ii and column jj, for every i=1,,ni=1, \ldots, n and j=1,,nj=1, \ldots, n. Determine all integers n1n \geqslant 1 for which the sum of the n2n^{2} entries in the table is equal to 14n2(n1)\frac{1}{4} n^{2}(n-1).

Solutions — 2

Solution 1

Answer: All integers nn for which n+1n+1 is a prime.

First, observe that every pair x,yx, y of real numbers for which the sum x+yx+y is integer satisfies
x+yx+y1(1) \lfloor x\rfloor+\lfloor y\rfloor \geqslant x+y-1 \tag{1}
The inequality is strict if xx and yy are integers, and it holds with equality otherwise.
We estimate the sum SS as follows.
2S=1i,jn(ijn+1+ijn+1)=1i,jn(ijn+1+(n+1i)jn+1)1i,jn(j1)=(n1)n22. \begin{aligned} 2 S=\sum_{1 \leqslant i, j \leqslant n}\left(\left\lfloor\frac{ij}{n+1}\right\rfloor+\left\lfloor\frac{ij}{n+1}\right\rfloor\right)= & \sum_{1 \leqslant i, j \leqslant n}\left(\left\lfloor\frac{ij}{n+1}\right\rfloor+\left\lfloor\frac{(n+1-i)j}{n+1}\right\rfloor\right) \\ & \geqslant \sum_{1 \leqslant i, j \leqslant n}(j-1)=\frac{(n-1)n^{2}}{2} . \end{aligned}
The inequality in the last line follows from (1) by setting x=ij/(n+1)x=ij/(n+1) and y=(n+1i)j/(n+1)y=(n+1-i)j/(n+1), so that x+y=jx+y=j is integral.
Now S=14n2(n1)S=\frac{1}{4} n^{2}(n-1) if and only if the inequality in the last line holds with equality, which means that none of the values ij/(n+1)ij/(n+1) with 1i,jn1 \leqslant i, j \leqslant n may be integral.
Hence, if n+1n+1 is composite with factorisation n+1=abn+1=ab for 2a,bn2 \leqslant a, b \leqslant n, one gets a strict inequality for i=ai=a and j=bj=b. If n+1n+1 is a prime, then ij/(n+1)ij/(n+1) is never integral and S=14n2(n1)S=\frac{1}{4} n^{2}(n-1).

Solution 2

To simplify the calculation with indices, extend the table by adding a phantom column of index 0 with zero entries (which will not change the sum of the table). Fix a row ii with 1in1 \leqslant i \leqslant n, and let d:=gcd(i,n+1)d:=\operatorname{gcd}(i, n+1) and k:=(n+1)/dk:=(n+1) / d. For columns j=0,,nj=0, \ldots, n, define the remainder rj:=ijmod(n+1)r_{j}:=ij \bmod (n+1). We first prove the following

Claim. For every integer gg with 1gd1 \leqslant g \leqslant d, the remainders rjr_{j} with indices jj in the range
(g1)kjgk1(2) (g-1)k \leqslant j \leqslant gk-1 \tag{2}
form a permutation of the kk numbers 0d,1d,2d,,(k1)d0 \cdot d, 1 \cdot d, 2 \cdot d, \ldots, (k-1) \cdot d.

Proof. If rj=rjr_{j'}=r_{j} holds for two indices jj' and jj in (2), then i(jj)0mod(n+1)i(j'-j) \equiv 0 \bmod (n+1), so that jjj'-j is a multiple of kk; since jjk1|j'-j| \leqslant k-1, this implies j=jj'=j. Hence, the kk remainders are pairwise distinct. Moreover, each remainder rj=ijmod(n+1)r_{j}=ij \bmod (n+1) is a multiple of d=gcd(i,n+1)d=\operatorname{gcd}(i, n+1). This proves the claim.

We then have
j=0nrj=g=1d=0(n+1)/d1d=d212(n+1d1)n+1d=(n+1d)(n+1)2.(3) \sum_{j=0}^{n} r_{j}=\sum_{g=1}^{d} \sum_{\ell=0}^{(n+1)/d-1} \ell d=d^{2} \cdot \frac{1}{2}\left(\frac{n+1}{d}-1\right) \frac{n+1}{d}=\frac{(n+1-d)(n+1)}{2} . \tag{3}
By using (3), compute the sum SiS_{i} of row ii as follows:
Si=j=0nijn+1=j=0nijrjn+1=in+1j=0nj1n+1j=0nrj=in+1n(n+1)21n+1(n+1d)(n+1)2=(inn1+d)2 \begin{align*} S_{i}=\sum_{j=0}^{n}\left\lfloor\frac{ij}{n+1}\right\rfloor & =\sum_{j=0}^{n} \frac{ij-r_{j}}{n+1}=\frac{i}{n+1} \sum_{j=0}^{n} j-\frac{1}{n+1} \sum_{j=0}^{n} r_{j} \\ & =\frac{i}{n+1} \cdot \frac{n(n+1)}{2}-\frac{1}{n+1} \cdot \frac{(n+1-d)(n+1)}{2}=\frac{(in-n-1+d)}{2} \tag{4} \end{align*}
Equation (4) yields the following lower bound on the row sum SiS_{i}, which holds with equality if and only if d=gcd(i,n+1)=1d=\operatorname{gcd}(i, n+1)=1 :
Si(inn1+1)2=n(i1)2.(5) S_{i} \geqslant \frac{(in-n-1+1)}{2}=\frac{n(i-1)}{2} . \tag{5}
By summing up the bounds (5) for the rows i=1,,ni=1, \ldots, n, we get the following lower bound for the sum of all entries in the table
i=1nSii=1nn2(i1)=n2(n1)4.(6) \sum_{i=1}^{n} S_{i} \geqslant \sum_{i=1}^{n} \frac{n}{2}(i-1)=\frac{n^{2}(n-1)}{4} . \tag{6}
In (6) we have equality if and only if equality holds in (5) for each i=1,,ni=1, \ldots, n, which happens if and only if gcd(i,n+1)=1\operatorname{gcd}(i, n+1)=1 for each i=1,,ni=1, \ldots, n, which is equivalent to the fact that n+1n+1 is a prime. Thus the sum of the table entries is 14n2(n1)\frac{1}{4} n^{2}(n-1) if and only if n+1n+1 is a prime.

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 reproduced verbatim; metadata (topic, difficulty) added by this project.