Answer
(a) $f(n)=625\left(\frac{4}{5}\right)^{n-1}$
(b) After $5$ swings.
Work Step by Step
(a) Common ratio $r=\frac{500}{625}=\frac{4}{5}$
First term $a_{1}=625$.
For geometric sequence, $n$th term is given by
$f(n)=a_{1}r^{n-1}$
Therefore in the $n$th swing, the distance the pendulum swings is
$f(n)=625\left(\frac{4}{5}\right)^{n-1}$
(b) Given $f(n)=256$
$\implies 625\left(\frac{4}{5}\right)^{n-1}=256$
$\implies \left(\frac{4}{5}\right)^{n-1}=\frac{256}{625}$
$\implies \left(\frac{4}{5}\right)^{n-1}=\left(\frac{4}{5}\right)^{4}$
Equating the exponents, we have
$n-1=4$ or $n=4+1=5$