Artificial intelligent assistant

Linear Algebra (Matrix) An n×n matrix M of integers has the property that Mab=Mxy iff a+b=x+y. How many distinct elements are there in M?

The entries are constant along anti-diagonals, so the answer is $2n-1$.

By that, I mean that we have $m_{31} = m_{22} = m_{13}$, for instance, and the same for any line of entries that extends in a NE/SW direction (eg $m_{21} = m_{12}$. Since there are $2n-1$ such lines (for the index-sum values $2, 3, ..., 2n$), the result follows.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy f56bbedd36389083623f3c47fc0f8d8c