TITLE: An interesting series related to primes satisfying $\sum_n x_{nk} = 0$ for all $k$
QUESTION [10 upvotes]: Consider the series $\sum x_n$ where if $n$ is composite, say $n=p_1^{k_1}....p_m^{k_m}$ then $x_n=x_{p_1}^{k_1}....x_{p_m}^{k_m}$ and if $n$ is prime, $x_p=-x_1-...-x_{p-1}$. I want to determine whether an $x_1\neq 0$ exists such that $\sum x_n=0$. It feels like this will be true for all $|x_1|<1$ or none(more clear after getting a feel for the series). This would have the interesting consequence that $\sum x_{kn}=0$ for all integers $k$.
I have also written/copied from the internet a generator for the sequence in python, found here https://pastebin.com/jcqvSS0W
The sequence feels more related to prime gaps rather than anything to do with primes being prime, which makes me suspect this is a difficult question.

REPLY [2 votes]: Put $r=|x_1|$ for simplicity. Here is a significantly shorter proof than my previous one, with the same conclusion: If $|r|<1/8$, then the sum converges (and does so absolutely).  Moreover, we can bound the sum by $r+\tfrac{1}{4} (1 - \sqrt{1-8r})$.
Put $F(N) = \sum_{n=2}^N |f(n)|$. Notice that, if $p<q$ are two consecutive primes, then
$$\sum_{n=1}^p f(n) = \sum_{n=1}^q f(n) = 0$$
so
$$f(q) = - \sum_{n=p+1}^{q-1} f(n).$$
Summing this equation up over all primes up to $N$, we deduce
$$\sum_{q=2,\\ q\ \text{prime}}^n f(q) = f(2) - \sum_{c=4,\\ c \ \text{composite}}^N f(c).$$
Therefore,
$$F(N) = \sum_{n=2}^N |f(n)| \leq |f(2)| + 2 \sum_{c=4,\\ c \ \text{composite}}^N |f(c)| = r + 2 \sum_{c=4,\\ c \ \text{composite}}^N |f(c)|.$$
Now, for $c$ any composite $\leq N$, let $p$ be the least prime divisor of $c$; then $p \leq \sqrt{N}$ and $c/p \leq N/2$. So
$$\sum_{c=4,\\ c \ \text{composite}}^N |f(c)| \leq F(\sqrt{N}) F(N/2)$$
and we deduce that
$$F(N) \leq r + 2 F(\sqrt{N}) F(N/2). \qquad (\ast)$$
Now note that, if $y \leq \tfrac{1}{4} (1 - \sqrt{1-8r})$, then $r+2y^2$ is also $\leq \tfrac{1}{4} (1 - \sqrt{1-8r})$. So $(\ast)$ allows us to inductively bound $F(N) \leq  \tfrac{1}{4} (1 - \sqrt{1-8r})$ for all $N$. Remembering that $|f(1)|=r$, we get the bound $r+\tfrac{1}{4} (1 - \sqrt{1-8r})$ for the sum starting at $n=1$.