Is there a non periodic sequence of 1 and 0 such that its power series can be analytically continued outside of the unit circle This is something i came across during my own research, i went around and asked quite a few people ( most of them teaching math at college ) and none did manage do give me a definite answer. Disclaimer: i post this from phone, so don't mind me writing formulas using only standard phone keyboard i currently work with, i will try my best to make it readable, + gonna be a bit longer post.
The question is following:
Is there a function f: $\mathbb{N} \to \{0, 1\}$ that satisfies the following:


*

*there is no ordered pair $(n, t)$ such that for each natural number $a$,
$$a>n \implies f(a)=f(a+t)$$
aka the tail of $f$ is not periodic.

*Let $g(z)=\sum_{k=1}^{k=\infty} f(k) z^k$, where $|z|<1$ aka $g$ is defined inside the unit circle of the complex plane excluding the circle boundary. $g(z)$ can be analytically continued to outside the unit circle.
What i know so far is that there are examples of functions that satisfy the first property and doesn't satisfy the second ; the ones i know of are $f(x)=1$ if $x=2^k, k$ natural, and $0$ otherwise, and one more with $k!$ instead of $2^k$.
Of course, it is easily shown that if the function doesn't satisfy the first property, it must satisfy the other one.
This is a simplified version of the problem where instead of $\{0, 1\}$, the codomain of $f$ is $\{0, 1, ... n\}$ for some fixed $n$.
This more general problem has came from an attempt to identify ( as many as possible ) the members of p-adic number system, where $p = n$ with complex values such that the set of numbers that can be identified in this way together with p-adic operations on them is isomorphic with the subfield of $\mathbb{C}$ that is made from elements they are identified with.
So that was a little bit of background. The main purpose of it was to suggest a possible candidate for $f$ in a more general version of the problem. Let $n=7$, and $x$ be one of the solutions of the equation $x^2=2$ in $\mathbb{Q}_7$, obviously there are 2 solutions opposite to each other ( $x_1+x_2 = 0$ ), $f(k)$ is then the $k$-th digit in the representation of x in $\mathbb{Q}_7$.
What i believe is that both solutions generate us a function that would satisfy both properties and that the values of analytic continuations of respective $g_1(z)$ and $g_2(z)$ at $z=7$ will be equal to $\sqrt{2}$ and $- \sqrt{2}$ respectively.
Ty for reading until the end and thank you for any help on the topic, i am looking forward to read the answers
 A: You are interested in lacunary functions.  Let us label your function, 
$$  g(z) = \sum_{k=1}^\infty f(k) z^k  \text{.} $$
It is an old result that if the coefficients of the series $g$ come from a finite set, and the sequence of coefficients in $g$ are not eventually periodic, then the series cannot be continued outside of the unit disk.    From Einar Hille's "Analytic Function Theory, vol. 2", p. 87

Another case is that in which the coefficients have only a finite number of distinct values.  If these values do not ultimately form a periodic sequence, the series is noncontinuable [outside the unit disk].

Bell et al. (Bell, Jason P., Nils Bruin, and Michael Coons, "Transcendence of Generating Functions Whose Coefficients are Multiplicative", https://arxiv.org/pdf/1003.2221.pdf ) give a start into the literature with their Theorem 1.2:

Theorem 1.2 (Carlson [10]).  A series $F(z) = \sum_{n \geq 1} f(n) z^n \in \mathbb{Z}[[z]]$ that converges inside the unit disk is either rational or it admits the unit circle as a natural boundary.

Of course, if it is rational, it is eventually periodic.
