I think is just for $a=2^p5^q$, with $p,q\geq 0 $ but I haven't a proof. In particular, the exercise says:
"Let $N$ be a natural number and $S_N=\{a\in \mathbb{N} \; :\; 1\leq a \leq N \; , \; 1/a\; \text{has a finite decimal representation}\}$. Compute $\displaystyle\lim_{N\to \infty} \frac{\vert S_N \vert}{\log^2N}$, where $\vert \cdot \vert$ is the cardinal number of a set.
If is true that $1/a$ has a finite decimal representation iff $a=2^p 5^q $, then $2^p \leq N \leftrightarrow p\leq \frac{\log N} {\log 2}$ and $5^q \leq N \leftrightarrow q\leq \frac{\log N} {\log 5}$ and maybe for $N$ big $\vert S_N \vert \sim \frac{\log^2 N}{\log 5 \log 2 }$?
$\frac 1a = \sum\limits_{k=1}^n a_k*10^{-k}$ has a finite representation of $n$ digits (i.e $a_n \ne 0$ $\iff$
$\frac {10^n}a = \sum\limits_{k=1}^na_k*10^{n-k}\in \mathbb Z$. So $a|10^n$ so $a = 2^p5^q$ for some integers $p, q$. Furthermore either $p$ or $q$ is equal to $n$.
Or in other words $a = 2^p5^q = 10^p5^{n-p}$ if $n= q$ or $a = 2^p5^q = 10^q2^{n-q}$ if $n=p$. (And if $p=q=n$ then $a = 10^n$).
Okay... so lets say $N = 10^m$ then $S_N = \{2^p2^q|0\le p \le m; 0\le q \le m\}$ and $|S_N| = (m+1)^2$ and $\frac{|S_N|}{\log^2 N} = \frac {m^2+2m + 1}{m^2} = 1 + \frac 2m + \frac 1{m^2}$.
So $\lim_{N\rightarrow \infty}\frac {|S_N|}{\log^2 N} = \lim_{m\rightarrow \infty}\frac{(m+1)^2}{m^2} = 1$.