There is a question I encountered which said to fill an $N \times N$ matrix such that each entry in the matrix is the smallest non-negative number which does not appear either above the entry or to its left. That is for $N = 6$ the matrix looks like this:
$$\begin{array}{} 0&1&2&3&4&5\\ 1&0&3&2&5&4\\ 2&3&0&1&6&7\\ 3&2&1&0&7&6\\ 4&5&6&7&0&1\\ 5&4&7&6&1&0 \end{array}$$
I was asked to find a function such that given row and column I can calculate the value at that point i.e
$$f(\text{row}, \text{column}) = \text{Matrix}[\text{row}][\text{column}]$$
I was looking at Nimbers and found the matrix in it exactly similar to it. There was also given a formula to calculate to calculate Matrix[row][column] which was row XOR column (XOR is bitwise exor).
However I was able to get the answer I am still unable as to how to arrive at the solution i.e. the proof that each entry in the matrix is the smallest non-negative number which does not appear either above the entry or to its left is equal to row XOR column.