Let us define the position for this game with a pair of numbers (m,n), where m – the number written on the board, and n – the number of a move. We assume a position being winning, if after having got into it, a player still has a winning strategy. A losing one – when having got into it, an opponent will have a winning strategy. Each player tries to reach the position (0,n) after his turn (that is to write down 0), that is why these positions are winning. Let us show that the map of winning-losing positions looks like in fig. 25.

Fig. 25
Let us note, that from the cell (m,n) one can get into the cell (m−1,n+1), (m−2,n+1), ..., (m−n,n+1) that is, one can move into the next right column, or one, two, ..., n cells down.
Having considered the values n=1,n=2,n=3, one can suggest that periods of winning and losing positions in the n-th column are as follows:
winning:[k2+nk;k2+nk+k],losing:[k2+nk+k+1;k2+nk+2k+n],k∈Z+.
We can prove this. That is, show that from each defined as a winning position one can get only into defined as a losing one, and from each position, defined as a losing, there exists a way into a position, defined as a winning.
Let on the n-th step, number m is written on the board, and there exists k∈N:
k2+nk≤m≤k2+nk+k (that is, the position is winning).
Then we can subtract number l, which is 1≤l≤n. The next move after that will be the (n+1)th. We have got:
m−l≥m−n≥k2+nk−n=(k−1)2+(n+1)(k−1)+(k−1)+1,
m−l≤m−1≥k2+nk+k−1=(k−1)2+(n+1)(k−1)+2(k−1)+(n+1).
As these are the final points of one losing range, then any move out of the winning position leads into the losing range for (k−1).
Let on the n-th step, number m is written on the board and there exists k∈N:
k2+nk+k+1≤m≤k2+nk+2k+n (that is, the position is losing).
Let us discover what happens if we subtract 1 or n. The move after that will be the (n+1)th. We have got:
k2+(n+1)k+2k+(n+1)≥k2+nk+n−1≥m−1≥k2+nk+k=k2+(n+1)k, that is, we will get into a losing range for k, or into a winning position.
k2+(n+1)k+k=k2+nk+2k≥m−n≥k2+nk+k+1−n≥
≥(k−1)2+(n+1)(k−1)+(k−1)+1,
that is, we will get into a losing range for (k−1), or into a winning position.
We can also get from number m to any number from (m−n) to (m−1). As these numbers belong to various losing ranges, there exists a winning range between them.
Thus, the chosen ranges are really winning or losing positions.
Let us see, into which range the position (2016;1) will get. Just as
[442+44=1980<2016<442+44+44=2024,
so this position is winning, hence the second player wins.