How many fields does the diagonal of a 1983 × 999 chessboard pass through?

Note: Please retain the line breaks and formatting of the source text in the translation output.
Every field that the diagonal crosses cuts a segment from the diagonal. The two endpoints of such a segment are the intersection points of the diagonal and the perimeter of the field. Therefore, we need to count how many segments the intersection points formed by the boundary lines of the fields divide the diagonal into.

The number of vertical lines is 1984, which means 1984 intersection points. The 1000 horizontal lines intersect the diagonal at 1000 points, but among these points, there will be some - for example, the first or the last - where vertical lines also pass. These points - that is, the vertices where the diagonal passes through - have been counted twice.

If the diagonal passes through a vertex, then the resulting rectangle is similar to the original, and if the side of the field is a unit, then its sides are also integers.

![](https://cdn.mathpix.com/cropped/2024_05_02_7165c7f6665720eb24eag-1.jpg?height=501&width=892&top_left_y=568&top_left_x=603)

For the sides, it holds that

$$
\frac{a}{b}=\frac{1983}{999} \quad \text { and } \quad 1 \leq a \leq 1983
$$

Conversely, for every pair of integers \(a, b\) that satisfy (1), there is a rectangle, as shown in the diagram, or a vertex through which the diagonal of the chessboard passes.

Since the greatest common divisor of 1983 and 999 is 3, from (1) we have \(\frac{a}{b}=\frac{661}{333}\), and this form cannot be simplified further. This means that \(a\) is an integer multiple of 661, and \(b\) is an integer multiple of 333. Moreover, \(a \leq 1983\), so (1) has exactly 3 solutions, namely

$$
a=661, b=333 ; \quad a=1322, b=666 \quad a=1983, b=999
$$

Thus, the diagonal passes through four vertices in total, two of which are also vertices of the chessboard, and the other two are the trisection points of the diagonal.

Therefore, the boundary lines of the fields intersect the diagonal line at \(1984 + 1000 - 4 = 2980\) points. The number of segments created is one less than this, so the diagonal of the chessboard passes through 2979 fields.

Remarks. 1. In the solution, we also showed that if the sides of the chessboard are relatively prime, then the diagonal of the chessboard does not pass through any field vertex inside the board.

2. It follows from the proof that the diagonal of a \(k \times n\) chessboard passes through \((k+n+1)-d\) fields, where \(d\) is the greatest common divisor of \(k\) and \(n\).