How to check quickly $\frac{2}{3}=.101010... $ holds? Every $x \in [0, 1]$ can be expressed in the form 
$\dfrac{a_1}{2}+\dfrac{a_2}{2^2}+\dots + \dfrac{a_m}{2^m}+\dots$ , where each $a_i$ equals either $0$ or $1$. For such $x$, we have the binary expansion $x = .a_1a_2 . . . a_m . . .$ .
How can I calculate say $\frac{2}{3}$ quickly in binary expansion form without calculating a_i's one by one manually. I need it for the topic of dynamical system and I don't know some method or available relevant calculator for that.
According to the book, $\frac{4}{5}=.11001100... $ and $\frac{2}{5}=.011001100... $ and $\frac{2}{3}=.101010... $; how to check them quickly?
Thank you.    

Checking is easy: If
$$x=0.{\bf q}{\bf p}{\bf p}{\bf p}{\bf p}\ldots\ ,\tag{1}$$
where the preperiod ${\bf q}$ and the period ${\bf p}$ are binary strings of length $r$ and $s$, respectively, then
$$2^rx={\bf q}.{\bf p}{\bf p}{\bf p}{\bf p}\ldots$$
and consequently
$$(2^r-1)x={\bf q}.{\bf p}-0.{\bf q}\ .$$
It follows that
$$x={{\bf q}.{\bf p}-0.{\bf q}\over 2^r-1}\ .$$
But grinding out the binary expansion $(1)$ for a given  rational number $x={m\over n}$ has to be done "by hand", i.e. using the well known division algorithm from primary school, which can take up to $n-1$ steps. Note that the decimal period of ${1\over7}=0.142857\ldots$ has length $6$.
