1. Let $p$ and $q$ be natural numbers and $\left(a_{n}\right)_{n=1}^{\infty}$ be an arithmetic progression for which $a_{p}$ is equal to $q$, and $a_{q}$ is equal to $p$.

Calculate the value of $a_{n}$.
Solution. Let the difference of the progression be denoted by $d$. From the condition of the problem, we have

$$
\left\{\begin{array}{l}
a_{1}+d(p-1)=q \\
a_{1}+d(q-1)=p
\end{array}\right.
$$

According to this,

$$
\begin{aligned}
& d(p-1)-d(q-1)=q-p \\
& d(p-q)=q-p
\end{aligned}
$$

which means $d=-1$. Now, $a_{1}=p+q-1$, from which we get

$$
a_{n}=p+q+d(n-1)=p+q-(n-1)
$$