24. Given the sequence $a_{1}=20, a_{2}=30, a_{n+2}=3 a_{n+1}-a_{n}$ $(n \geqslant 1)$. Find all positive integers $n$ such that $1+5 a_{n} a_{n+1}$ is a perfect square.
(19th Balkan Mathematical Olympiad)
Let $b_{n}=a_{n}+a_{n+1}, c_{n}=1+5 a_{n} a_{n+1}$, then
$5 a_{n+1}=b_{n+1}+b_{n}, a_{n+2}-a_{n}=b_{n+1}-b_{n}$.
Therefore, $c_{n+1}-c_{n}=5 a_{n+1}\left(a_{n+2}-a_{n}\right)=b_{n+1}^{2}-b_{n}^{2}$.
Thus, $c_{n+1}-b_{n+1}^{2}=c_{n}-b_{n}^{2}=\cdots=c_{1}-b_{1}^{2}$
$$
=501=3 \times 167 \text {. }
$$

Suppose there exist positive integers $n, m$ such that $c_{n}=m^{2}$, then $\left(m+b_{n}\right)\left(m-b_{n}\right)=3 \times 167$.
If $m+b_{n}=167, m-b_{n}=3$, then $m=85, c_{n}=85^{2}$.
If $m+b_{n}=501, m-b_{n}=1$, then $m=251, c_{n}=251^{2}$.
Since the sequence $\left\{a_{n}\right\}$ is strictly increasing, the sequence $\left\{c_{n}\right\}$ is also strictly increasing. Given $c_{1}=1+5 \times 20 \times 30<85^{2}<c_{2}=1+5 \times 30$ $\times 70<c_{3}=1+5 \times 70 \times 180=251^{2}$, there is only one $n$ that satisfies the condition, which is $n=3$.