4.39. Find all natural $n$ for which $\frac{1}{n}$ and $\frac{1}{n+1}$ are finite decimal fractions.
4.39. Answer: 1 and 4. For $n>1$, the equalities $2^{k} 5^{l}=n$ and $2^{s} 5^{t}=n+1$ must hold. The numbers $n$ and $n+1$ are coprime, so either the equality $2^{k}+1=5^{t}$ or the equality $5^{l}+1=2^{s}$ must hold. Suppose that $5^{l}+1=2^{s}$. Then the number $2^{s}$ ends in 6, so $s=4 m$. Therefore, $5^{l}=2^{4 m}-1=\left(2^{2 m}-1\right)\left(2^{2 m}+1\right)$. But the numbers $2^{2 m}-1$ and $2^{2 m}+1$ cannot both be divisible by 5.

Now consider the equation $2^{k}+1=5^{t}$. Let $t=2^{m} s$, where $s$ is odd. Then

$$
5^{t}-1=\left(5^{2^{m}}-1\right)\left(5^{2^{m}(s-1)}+5^{2^{m}(s-2)}+\ldots+1\right)
$$

The second factor consists of an odd number of odd terms, so it is odd. Therefore, $s=1$. Further,

$$
5^{2^{m}}-1=(5-1)(5+1)\left(5^{2}+1\right) \ldots\left(5^{2^{m-1}}+1\right)
$$

The number $5+1=6$ is not a power of two, so $m=0$. This corresponds to the equality $2^{2}+1=5$.