TITLE: Formal power series with coefficient in $\{0,1 \}$ which is not rational
QUESTION [10 upvotes]: Recall that $f \in \mathbb{C}[[x]]$ is rational if $f = ab^{-1}$ where $a, b \in \mathbb{Q}[x]$ (the inclusion  $ \mathbb{Q}[x] \to \mathbb{C}[[x]]$ is obvious).
How do I obtain an example of  $f \in \mathbb{C}[[x]]$ with coefficients $0,1$ which is not rational?  I have an experience of proving that some series is not rational (say, $exp(x)$).I could't come up with an example myself, though.

REPLY [3 votes]: Since $f = \sum c_nz_n$ has coefficients $0$ and $1$, $f(1/2)$ is the binary number $c_0.c_1c_2c_3 \dotsm$. If $f$ is rational this number is rational and hence ultimately periodic. Thus just choose a non ultimately periodic sequence to get a non-rational series.