5.4. Find all pairs $a_{n}, a_{n+1}$ of consecutive members of the sequence $a_{1}, a_{2} \ldots$, defined by $a_{n}=2^{n}+49$, so that

$$
a_{n}=p \cdot q, \quad a_{n+1}=r \cdot s
$$

where $p, q, r, s$ are prime numbers such that

$$
p<q, \quad r<s, \quad q-p=s-r
$$

## 6th BALKANIAN MATHEMATICAL OLYMPIAD

SPLIT, former Yugoslavia, May 1989.
5.4. We shall prove that the single pair of consecutive terms which verifies the given condition is $\left(a_{7}, a_{8}\right)$.

Let us put $q-p=s-r=x$. Then we have

$$
a_{n}=p(p+x), \quad a_{n+1}=r(r+x)
$$

The function $p \mapsto p(p+x)$ is increasing, therefore $p2 p(p+x)=2 a_{n}
$$

Hence $3<r<6$ and therefore $r=5$. Substituting the values $p=3$ and $r=6$ into the recurrence relation (1), one finds $5(5+x)=6(3+x)-49$, hence $x=56$. It follows that $a_{n}=3 \cdot 59$ and $a_{n+1}=5 \cdot 61$. One verifies directly that these numbers are $a_{7}=2^{7}+49$ and $a_{8}=2^{8}+49$.

Alternate solution. Denote $y=s-q=r-p$. Like in the previous solution we get

$$
a_{n}=3 q, \quad a_{n+1}=(3+y)(q+y)
$$

Therefore $(3+y)(q+y)=2^{n+1}+49=2^{n}+3 q$, i.e.

$$
y\left(\frac{2^{n}+49}{3}+y+3\right)=2^{n}
$$

If $y \geq 3$, then the left hand side of (1) is bigger than the right hand side, which is impossible. Also in case $y=1$ we have a contradiction: $a_{n+1}=4(q+1)$. So the only possibility left is $y=2$. Now from (1) we compute $n=7$ and the result follows easily.