Consider a function $g(n): \mathbb N \to \{0,1,2,3,4,5,6,7,8,9\}$, ie. $g$ maps the natural numbers to natural numbers between $0$ and $9$. Then, no matter what $g(n), \ n\in \mathbb N$ is, the sum $$\sum_{n=1}^\infty g(n)10^{-n}$$ converges to a number between $[0,1]$.
Now, take a function $f: \mathbb N \to \mathbb N$ and set $a(n) = (f(n) \bmod 10).$
Question: what can be said of the function $f(n)$, if $$\sum_{n=1}^\infty a(n)10^{-n} \in \mathbb Q?$$
Would this imply that $f(n)$ has a closed-form expression?
For example: $$\sum_{n=1}^\infty (n \bmod 10) 10^{-n} = \frac{137174210}{1111111111}$$ and $$\sum _{n=1}^{\infty} 10^{-n} (2^n \bmod 10)=\frac{226}{909}.$$
If $f(n)$ has no closed form expression, is $$\sum_{n=1}^\infty a(n)10^{-n} \in \mathbb R \setminus \mathbb Q?$$ For example, if $f(n) = \varphi(n)$ is Euler's totient function, is $$\sum_{n=1}^\infty (\varphi(n) \bmod 10) 10^{-n} \in \mathbb R \setminus \mathbb Q?$$