4. A cinema received 234 visitors. Determine for which $n \geqq 4$ it could have happened that the visitors could be seated in $n$ rows such that each visitor in the $i$-th row knew exactly $s_j$ visitors in the $j$-th row for any $i, j \in\{1,2, \ldots, n\}, i \neq j$. (The relationship of knowing is symmetric.)

(Tomáš Jurík)
Solution. For each $k \in\{1,2, \ldots, n\}$, let $p_{k}$ be the number of viewers in the $k$-th row. The condition of the problem for given $i$ and $j$ means that the number of acquaintances between viewers in the $i$-th and $j$-th rows is equal to $j p_{i}$. By swapping the roles of the numbers $i$ and $j$, we find that the same number must equal $i p_{j}$. Therefore, it must hold that $j p_{i}=i p_{j}$, or $p_{i}: p_{j}=i: j$. We thus arrive at the conclusion that the numbers $p_{k}$ of viewers in the individual rows necessarily satisfy the condition

$$
p_{1}: p_{2}: \ldots: p_{n}=1: 2: \ldots: n
$$

Let us show that this is also a sufficient condition, that is, that for counts $p_{k}=k d$ for a suitable integer $d$, the viewers could have known each other in such a way that the condition of the problem is satisfied. For $d=1$, this is certainly the case when all viewers in the cinema know each other; for a general $d$, it suffices that the viewers are divided into $d$ groups of mutually acquainted viewers and that the viewers from each such group are seated in the rows in the same way as in the case $d=1$.

Our task is thus to determine for which $n \geqq 4$ there exists a positive integer $d$ satisfying the equation

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

We are thus looking for all divisors of the number $468=2^{2} \cdot 3^{2} \cdot 13$ that are of the form $n(n+1)$. Since $22 \cdot 23>468$, it must hold that $n<22$, i.e., $n \in\{4,6,9,12,13,18\}$. We see that only $n=12$ (with the corresponding $d=3$) satisfies this.

Answer. The described situation could have occurred only with the seating of viewers in 12 rows.