0
$\begingroup$

This question is inspired by trying to understand the lexicographic sorting of the natural numbers in the fractal at this question: Is $1 = \sum_{n=1}^{\infty} \frac{\pi(p_n^2)-n+2}{p_n^3-p_n}$ , where $\pi$ denotes the prime counting function and $p_n$ denotes the $n$-th prime?

Let $P_1(n) := 1$ if $n=1$ and $\max_{q|n, \text{ }q\text{ prime}} q$ otherwise, denote the largest prime divisor of $n$.

Let us define some rooted trees $T_{n,m}$ for $1 \le m \le n$ by:

  1. $T_{n,m}$ has as root the number $m$.
  2. If there are primes $p$ such that $P_1(m) \le p \le \frac{n}{m}$, then the children of $m$ are $T_{n,mp}$, otherwise $m$ is a leaf.

We set $T_n := T_{n,1}$. Example of such trees for $n=1,\cdots,6$ are shown below:

tree_1 tree_2 tree_3 tree_4 tree_5 tree_6

We associate to this tree $T_{12}$: tree_12

the following functions, which are inspired by continued fractions:

$$e_{12}(x)= \frac{1}{11^{x} + 7^{x} + 5^{x} + \frac{3^{x}}{9^{x}} + \frac{2^{x}}{10^{x} + 6^{x} + \frac{4^{x}}{12^{x} + 8^{x}}}} $$ $$p_{12}(x)= \frac{x}{x^{11} + x^{7} + x^{5} + \frac{x^{2}}{x^{10} + x^{6} + \frac{x^{4}}{x^{12} + x^{8}}} + \frac{1}{x^{6}}} $$

We plot the function $p(T_{12},x)$ and see how it looks like around $x=1$, where $\pi(n)$ counts the number of primes $p,p \le n$:

poly_tree_12

The definition for $p(T_{n,m},x)$ is given here:

$$p(T_{n,m},x) := \frac{x^m}{\sum_{m \rightarrow v}p(T_{n,v},x)}, \text{ if }m\text{ is not a leaf}$$

and $p(T_{n,m},x) := x^m, \text{ if }m\text{ is a leaf}$.

Let $c(n):=\frac{1}{p(T_{n,1},1)}$. Then we observe and formulate the following conjecture:

  1. $c(n) \le \pi(n) \forall n \ge 2$
  2. $c(n) \approx \pi(n)$

Here is a plot for this conjecture $n=1000$, green = $\pi(x)$, red = $\operatorname{Li}(x)$, blue = $c(m)$:

counting_primes_with_trees

Using induction on $n$ one can prove that $n \ge 2$:

$$p(T_{n+1},x) = \frac{x}{\frac{x}{p(T_n,x)}+x^{n+1}}, \text{ if } n+1 \text{ is prime}$$ and $$p(T_{n+1},x) = \frac{x}{\frac{x}{p(T_n,x)}+p(T_{n+1,p_1(n+1)},x)-p(T_{n,p_1(n+1)},x)}, \text{ if } n+1 \text{ is not a prime}$$

where $p_1(m) := 1 $ if $m=1$ and $p_1(m):= \min_{q, q \text{ prime }} q$ is the smallest prime which divides $m$.

From this last observation it follows that:

$$c(n+1) = c(n) + p(T_{n+1,p_1(n+1)},1)-p(T_{n,p_1(n+1)},1),\text{ if } n+1 \text{ is not prime}$$ and $$c(n+1) = c(n) + 1,\text{ if } n+1 \text{ is prime}$$ and so we get:

$$c(n) = \pi(n) + \sum_{1 \le k \le n , k \text{ is composite}} \left( p(T_{k,p_1(k)},1)-p(T_{k-1,p_1(k)},1) \right)$$

I am interested if the conjectures above are true and can be proven or if there exist counterexamples.

I am also interested in the sequence of rational functions $p(T_n,x)$ in the interval $(0,2)$, if it approaches the zero function and what can be said about the growths of these functions?

Thanks for your help.

Comment:

Having drawn such a tree $T_n$ we observe, that it is very easy to find the prime factorization of every number $1 \le m \le n$ in this tree, by starting at the node $m$ and then looking to the parent $v$ of $m$ to form the prime factor $p=\frac{v}{m}$ of $m$. We continue this way up the tree until the root $1$ and collect prime factors of $m$, which encode the factorization of $m$. The tree can be filled inductively by putting $n+1$ in the tree of $T_n$. For this one needs to know the prime factorization of $n+1 = p_1 \cdot p_2 \cdots p_r$ where $p_i \le p_{i+1}$. One starts at $1$ and goes down the branch which has $p_1/1$ as the prime and removes $p_1$ from the list of prime factors. Then one choses $v$ such that $v/p_1=p_2$ and so on and puts the number $n+1$ if there is not such a $v$ any more or if there the prime factors list contains one last prime factor.

The method to associate a fraction to a tree is borrowed from continued fractions (with $b_0=0$) and generalised continued fractions (with $b_0=0$), where in case of continued fractions it has $1$ at the root, and $b_1$ at it's left child, while it has $1$ at the right child and this has $b_2$ as it's left child and $1$ as it's right child. So it is a possible infinte binary tree which is associated to a continued fraction. The idea is to reverse this process and to associate to a possibly infinte tree with natural numbers as nodes a fraction or a real number, provided it converges.

Second question: Are there generalizations of continued fractions to arbitrary trees in the literature, the way I described it above? (I found Is there any pattern to the continued fraction of $\sqrt[3]{2}$? and the references given there, but it is not quite the construction I was asking).

$\endgroup$

2 Answers 2

2
$\begingroup$

Note that for any $m$ which isn't a leaf, due to Bertrand's postulate, there must be a prime in the range $\frac{n}{2m} < p \leq \frac{n}m$, and then $mp$ must be a leaf. Therefore, we have $p(T_{n,m}, 1) \leq 1$, which easily proves the first conjecture. Regarding the second one, we can see that for every $p > \sqrt n$, $T_{n,p}$ is a leaf, so $c(n) = \sum_{p\leq n\\ p\text{ prime}}p(T_{n,p},1) \geq \sum_{\sqrt n<p\leq n\\ p\text{ prime}}p(T_{n,p},1) = \sum_{\sqrt n<p\leq n\\ p\text{ prime}} 1 = \pi(n) - \pi(\sqrt n) \approx \pi(n)$ (the $p$ there is a bit confusing, but it should be obvious from context which $p$ is which), so by sandwich with the first inequality we get $c(n) \approx \pi(n)$.

$\endgroup$
3
  • $\begingroup$ Thanks. (+1) Your arguments are very concise. I hope to understand them. I do not understand your conclusion $p(T_{n,m},1) \le 1$ and how it proves the first conjecture. Thanks for your answer and insight in this question. Regarding the second conjecture, why is $c(n) = \sum_{p \le n} P(T_{n,p},1)$? $\endgroup$ Commented Dec 12, 2023 at 4:24
  • $\begingroup$ @mathoverflowUser Each non-leaf node must have a leaf as a child, and that leaf has a value of $1$, so in $p(T_{n,m}, 1)$ the numerator is $1$ and the denominator is at least $1$, so $p(T_{n,m}, 1) \leq 1$. This proves the first conjecture using the same $c(n) = \sum_{p \leq n \\ p\text{ prime}} p(T_{n, p}, 1)$, which is obtained by substituting the definition of $p(T_{n,1}, 1)$ in the definition of $c(n)$. $\endgroup$ Commented Dec 12, 2023 at 5:44
  • 2
    $\begingroup$ Ok, yes, now it is obvious that $c(n) = \sum_{p\le n, p \text{ prime }} p(T_{n,p},1)$ because these are just the branches of the root $1$. I did not see that immediately, although I have thought about it in this direction. $\endgroup$ Commented Dec 12, 2023 at 5:48
0
$\begingroup$

I could find a theory for the $p_{\infty}(x)$ with the help of ChatGPT:

We show that the complete set of prime factorizations of $1,\ldots,n$ is faithfully encoded by a Dyck word $w_n$ of length $2n$ that captures the shape of a prime-multiplication tree $T_n$. From $w_n$ alone and the list of primes up to $n$, all factorizations can be enumerated in total time $\Theta(n\log\log n)$ and $O(n)$ space, which is optimal up to constants due to the output size. We formalize admissible insertions, prove local commutativity and global confluence (any linear extension of the ancestor poset yields $T_N$), and investigate the direct limit tree $T_\infty$. A self-similar functional system leads to a branched Stieltjes continued-fraction representation for a root-weight generating function $p_\infty$, from which we derive simple bounds and stable numerical schemes. Under an explicit uniform-insertion heuristic, the pooled insertion index obeys an exact mixture-of-uniforms law with density $f(x)=-\log x$ on $(0,1)$, matching simulations. We conclude with connections to prime series and estimators for $\pi(n)$.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.