Question 40
Let $n$ be a positive integer. We consider sequences of numbers $a_{0}, a_{1}, \ldots, a_{k}$ and $b_{0}, b_{1}, \ldots, b_{k}$ satisfying $a_{0}=b_{0}=1$ and $a_{k}=b_{k}=n$ and such that for every $i$ with $1 \leq i \leq k$ we have that $(a_{i}, b_{i})$ is equal to either $(1+a_{i-1}, b_{i-1})$ or $(a_{i-1}, 1+b_{i-1})$. For $1 \leq i \leq k$ define the number
$$
c_{i}= \begin{cases}a_{i} & \text{ if } a_{i}=a_{i-1} \\ b_{i} & \text{ if } b_{i}=b_{i-1}\end{cases}
$$
Prove that $c_{1}+c_{2}+\cdots+c_{k}=n^{2}-1$.
$$
c_{i}= \begin{cases}a_{i} & \text{ if } a_{i}=a_{i-1} \\ b_{i} & \text{ if } b_{i}=b_{i-1}\end{cases}
$$
Prove that $c_{1}+c_{2}+\cdots+c_{k}=n^{2}-1$.