189*. The sequence $\left(a_{n}\right)$ satisfies the conditions:

$$
a_{1}=0, \quad a_{n+1}=\frac{n}{n+1}\left(a_{n}+1\right)
$$

Find the formula for $a_{n}$.
$\triangle$ Transform the second condition as follows:

$$
a_{n+1}+1=\frac{n}{n+1}\left(a_{n}+1\right)+1, \quad(n+1)\left(a_{n+1}+1\right)=n\left(a_{n}+1\right)+(n+1)
$$

The last equality suggests introducing a new sequence $b_{n}=n\left(a_{n}+1\right)$. It satisfies the initial condition $b_{1}=1$ and the recurrence relation

$$
b_{n+1}=b_{n}+n+1
$$

Let's find the formula for $b_{n}$ in a familiar way. (Do this on your own.) It should result in: $b_{n}=\frac{n(n+1)}{2}$.

Now it is not difficult to obtain the formula for $a_{n}$:

$$
a_{n}+1=\frac{b_{n}}{n}=\frac{n+1}{2}, \quad a_{n}=\frac{n+1}{2}-1=\frac{n-1}{2}
$$

Answer: $a_{n}=\frac{n-1}{2}$.