Question:Let $M_{n}$ be a square $n \times n$ matrix. I write $S_k$ for the $k-$th skew diagonals of $M_{n}.$ If I include the top left and bottom right corners of $M_n$, namely cells $a_{11}$ and $a_{nn}$ then it is easy to verify there are $2n-1$ such skew diagonals. And so I label them
$$ S_{1}, S_{2},\ldots,S_{n-1}S_{n},S_{n+1},\ldots,S_{2n-1} $$ I write $\text{cells}\left(S_{k}\right)$ to count the number of matrix cells along the $k-$th skew diagonal; where $1 \leq k \leq 2n-1.$ What is the formula for $\text{cells}\left(S_{k}\right)$ ?
Here is an example. In a $5 \times 5$ matrix we have $\text{cells}\left(S_{7}\right)=3.$ Surely $\text{cells}\left(S_{k}\right)=n$ whenever $k\leq n.$
For $1\leq i \leq 2n-1$ we have $$S_i=n-|n-i|$$ Or in others words $S_i=i$ when $1\leq i\leq n$ and $S_i=2n-i$ when $n\leq i \leq 2n-1$.