Consider the following grid where all natural numbers are written diagonally.

| $\ddots$ |  |  |  |  |  |
| :---: | :---: | :---: | :---: | :---: | :---: |
| 10 | $\ddots$ |  |  |  |  |
| 6 | 9 | $\ddots$ |  |  |  |
| 3 | 5 | 8 | 12 | $\ddots$ |  |
| 1 | 2 | 4 | 7 | 11 | $\ddots$ |

Each square has a position denoted by $(x, y)$, where $x$ represents the column, counted from left to right, and $y$ represents the row, counted from bottom to top. For example, 12 is the number written in the square at position $(4,2)$:

a) Determine the number that is in the square at position $(4,4)$.

b) Determine the number that is in the square at position $(1,2016)$.

c) Determine the number that is in the square at position $(2013,2017)$.
Solution

a) We can fill in more squares on the displayed board to find the square $(4,4)$:

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

Therefore, the number in the square $(4,4)$ is 25.

b) The number in the square $(1, n)$ is on a diagonal containing the squares $(x, y)$ such that $x+y=n+1$. That is, on the diagonal it is on, there are $n$ numbers, namely the numbers in the squares $(1, n),(2, n-1),(3, n-2), \ldots,(n, 1)$. Repeating this count for the numbers in the squares $(1, n-1),(1, n-2), \ldots,(1,1)$, we can see that $1+2+\ldots+(n-1)$ numbers have already been written in the other diagonals. Therefore, the number written in the square $(1, n)$ corresponds to the integer

$$
1+2+3+\ldots+n=\frac{n(n+1)}{2}
$$

Thus, the number in the square $(1,2016)$ is $\frac{2016 \cdot 2017}{2}$.

c) Since the square $(m, n)$ is on the diagonal containing the squares $(x, y)$ with $x+y=m+n$, we will first find the number written in $(m+n-1,1)$. From the previous item, the square $(1, m+n-2)$ has the number $\frac{(m+n-2)(m+n-1)}{2}$. Therefore, the number written in the square $(m+n-1,1)$ is $\frac{(m+n-2)(m+n-1)}{2}+1$. Moreover, the square $(m, n)$ is the $(n-1)$-th successor of the number written in the square $(m+n-1,1)$, that is, the number

$$
\begin{aligned}
\frac{(m+n-2)(m+n-1)}{2}+1+(n-1) & = \\
\frac{m^{2}+m n-m+m n+n^{2}-n-2 m-2 n+2+2+2 n-2}{2} & = \\
\frac{n(n+1)+m(m-1)+2(m-1)(n-1)}{2} & = \\
\frac{n(n+1)}{2}+\frac{m(m-1)}{2}+(m-1)(n-1) &
\end{aligned}
$$

Therefore, the number written in the square $(2013,2017)$ is

$$
\frac{2013 \cdot 2012}{2}+\frac{2017 \cdot 2018}{2}+2012 \cdot 2016
$$