
4. There are 234 visitors in a cinema auditorium. The visitors are sitting in $n$ rows, where $n \geqslant 4$, so that each visitor in the $i$-th row has exactly $j$ friends in the $j$-th row, for any $i, j \in\{1,2, \ldots, n\}, i \neq j$. Find all the possible values of $n$. (Friendship is supposed to be a symmetric relation.)

(Tomáš Jurík)


Solution. For any $k \in\{1,2, \ldots, n\}$ denote by $p_{k}$ the number of visitors in the $k$-th row. The stated condition on given $i$ and $j$ implies that the number of friendly pairs $(A, B)$, where $A$ and $B$ are from the $i$-th row and from $j$-th row respectively, is equal to the product $j p_{i}$. Interchanging the indices $i$ and $j$, we conclude that the same number of friendly pairs $(A, B)$ equals $i p_{j}$. Thus $j p_{i}=i p_{j}$ or $p_{i}: p_{j}=i: j$, and therefore, all the numbers $p_{k}$ must be proportional as follows:

$$
p_{1}: p_{2}: \cdots: p_{n}=1: 2: \cdots: n \text {. }
$$

Let us show that under this proportionality the visitors can be friendly in such a way which ensures the property under consideration. Thus assume that for some positive integer $d$, the equality $p_{k}=k d$ holds with any $k \in\{1,2, \ldots, n\}$. Let us
start with the case $d=1$ when the numbers of visitors in single rows are successively $1,2, \ldots, n$. Then the stated property holds true if (and only if) any two visitors taken from distinct rows in the whole auditorium - are friends. In the case when $d>1$, let us divide all the visitors into $d$ groups $G_{1}, G_{2}, \ldots, G_{d}$ so that for arbitrary $k=1,2, \ldots, d$, the numbers of visitors from the group $G_{k}$ in single rows are successively $1,2, \ldots, n$. It is evident that the stated property holds true under the following condition: two visitors are friends if and only if they belong to the same group $G_{k}$.

It follows from the preceding that our task is to find such integer values of $n$, $n \geqslant 4$, for which there exists a positive integer $d$ satisfying the equation

$$
d+2 d+\cdots+n d=234 \quad \text { or } \quad d n(n+1)=468 \text {. }
$$

Thus we look for all divisors $468=2^{2} \cdot 3^{2} \cdot 13$ which are of the form $n(n+1)$. Inequality $22 \cdot 23>468$ implies that $n<22$ and hence $n \in\{4,6,9,12,13,18\}$. It is easy to see that the only satisfactory $n$ equals 12 (which corresponds to $d=3$ ).

Answer. The unique solution is $n=12$.
