397. Find the conditions under which the squares of three consecutive terms of an arithmetic progression are three consecutive terms of a geometric progression.
Let $a, a+d, a+2 d$ be three consecutive terms of an arithmetic progression. If the squares of these numbers form a geometric progression, then

$$
(a+d)^{2}=\sqrt{a^{2}(a+2 d)^{2}}
$$

or

$$
(a+d)^{2}= \pm a(a+2 d)
$$

If

$$
(a+d)^{2}=a(a+2 d)
$$

then $d=0$

If

$$
(a+d)^{2}=-a(a+2 d)
$$

then

$$
d=a(-2 \pm \sqrt{2})
$$

The found expressions for $d$ are the required conditions.