Chaves picked up a board and started writing the positive natural numbers in its cells following a logical sequence, as shown in the figure.

| 1 | 2 | 9 | 10 | 25 | $\cdots$ |
| :---: | :---: | :---: | :---: | :---: | :---: |
| 4 | 3 | 8 | 11 | 24 | $\cdots$ |
| 5 | 6 | 7 | 12 | 23 | $\cdots$ |
| 16 | 15 | 14 | 13 | 22 | $\cdots$ |
| 17 | 18 | 19 | 20 | 21 | $\cdots$ |
| $\cdots$ | $\cdots$ | $\cdots$ | $\cdots$ | $\cdots$ |  |

a) Which row is the number 2,019 in?

b) If the board is $10 \times 10$, that is, only up to the number 100, what is the sum of the numbers in the 1st row?

c) If the board is $n \times n$, what is the last number of the diagonal $(1,3,7,13, \ldots)$?
Solution

a) In the $1^{st}$ row (horizontal), we have the squares of the odd natural numbers $\left(1^{2}, 3^{2}, 5^{2}, \ldots\right)$ in the $1^{st}$, $3^{rd}$, $5^{th}$, ..., positions and in the $2^{nd}$, $4^{th}$, $6^{th}$, ..., positions, we have the successors of these squares $\left(1^{2}+1,3^{2}+1,5^{2}+1, \ldots\right)$. In the $1^{st}$ column (vertical), we have the squares of the positive even natural numbers in the $2^{nd}$, $4^{th}$, $6^{th}$, ..., positions and in the $3^{rd}$, $5^{th}$, $7^{th}$, ..., positions, the successors of these squares. Since $45^{2}=2,025$ is in the $1^{st}$ row, then 2,019 is in the $7^{th}$ row ( $2,025-$ $2,018=7$ ).

b) We have:

$$
1+2+9+10+25+26+49+50+81+82=335
$$

c) Since the board is square, the last number written, $n^{2}$, will be the last number in the $1^{st}$ row or the $1^{st}$ column, depending on the parity of $n$. We just need to "trace back" along the sequence until we reach the last number on the diagonal, which means we only need to subtract the number $n-1$ from $n^{2}$, that is, the last number on the diagonal is $n^{2}-(n-1)$.