Euclid's proof is typically regarded as very weak, because it produces a density which is extremely thin. My question is how far the most obvious generalizations of Euclid's algorithms (for definiteness, algorithm E2) partially fix this problem. In particular, does E2 produce a smooth monotone $\pi(n)$ which asymptotically grows at least like log(N)?


The algorithms which to me are the obvious generalizations:


* E1. Given a set P of primes, partition it into into two parts A and B, multiply the primes in A and the primes in B, and either add or subtract the two products. These $2^{|P|}$ numbers are all coprime to all the numbers in P.
* E2. Given any partition of P into K disjoint subsets $A\_1, \ldots , A\_K$, Generate 
$E\_k(A\_k) = \sum\_{1\le k\le K} {\pm (k)} \prod\_{p \in (P-A\_k)} p $,  

where ${\pm(k)}$ is a sign for each partition. In words: multiply all the primes in the complement of each partition and add the results with arbitrary signs. These are all coprime too.
* E3. Given any list of K exponents $e(p,k)$ for each prime p and $k\in {1..K}$, where for each fixed p, exactly one of the e(p,k) is zero, the broadest reasonable generalization is to generate coprime numbers with multiplicity:  

$E\_k(A\_k,e) = \sum\_{1\le k\le K} {\pm (k)} \prod\_{p\in P} p^{e(p,k)} $


Algorithm E3 produces an infinite list of coprimes, so consider E2. Starting with the set {2}, and applying algorithm E2, you get a very dense list of new primes, at least for a while. I am asking the weakest question I can think of, namely does E2 produces a better than 1/x density, and a better than logarithmic growth for the prime counting function, when iterated from an initial segment of primes:


Question: Does algorithm E2 produce enough new coprimes to prove that p(x)> clog(x)


### Heuristics


The reason I am asking for such weak growth is because of the following (very bad, but perhaps essentially accurate) heuristic: let $\pi(N)$ be the prime counting number, and partition the primes less than $N$ into subsets of just one prime. There are about $2^{\pi(N)}$ E2 coprimes of this form, and I will only consider these. I will assume that all they are all distinct, and prime, since when they factor, they make more primes. So that, calling P(N) the product of all primes less than N


$\pi(P) >\approx 2^{\pi(N)}$


which, since $P = (2^{\pi(N)}) ^{\overline{\log\_2 p}}$, where $\overline{\log\_2 p}$ is the mean of the base two logarithm of all primes less than N. Assuming that the average log is $\log\_2(N)$ (which overestimates \pi(N), one finds


$\pi((2^{\pi(N)})^{\log\_2 N} ) \approx 2^{\pi(N)}$


which, calling the big number $2^{\pi(N)}$ by the name A, says that


$\pi(A^{\log\_2(N)}) \approx A$


and noting that N is about log(A) up to what matters, one finds that


$\pi(A^{\log\_2(\log\_2(A))}) = A$


so that the heuristic lower bound for $\pi(x)$ is asymptotically approximately the inverse function of $x^{\log\_2(\log\_2(x))}$, i.e. eventually approximately logarithmic.


(the motivation for this question is an [[What are some proofs of Godel's Theorem which are \*essentially different\* from the original proof?](https://mathoverflow.net/questions/72062/what-are-some-proofs-of-godels-theorem-which-are-essentially-different-from-th/72151#72151) unrelated answer] to an unrelated question)


### Embarassing Omission


LATER EDIT: I thought E2 was the interesting algorithm, but set of numbers generated by E3:


1. is closed under products
2. is closed under adding multiples of P, where P is the product of all the primes in the original set.


So the only way it can fail to generate the full multiplicative group mod P is if by some miracle it stays in a multiplicative subgroup, and that's ridiculous, but ridiculous is not a proof. Given this the restriction of multiplicity to get E2 starts to look completely artificial.


At least this easier observation would completely answer the original nebulous motivating question: Euclid's proof, when turned into the most general equivalent algorithm, does generate all the primes by finding the next primes for any given collection of primes (but one needs an exponent bound to make the algorithm effective). So, I guess a much better question would be the following conjecture:


Q2(conjecture): E3 starting with an initial set of primes gives all the coprimes.



How many primes does Euclid's prime generating algorithm really produce?
You might be interested in the papers Guy, Lacampagne, and Selfridge, Primes at a glance, Math. Comp. 48 (1987) 183-202, and Agoh, Erdos, and Granville, Primes at a (somewhat lengthy) glance, Amer. Math. Monthly 104 (1997) 943-945. In the second paper, it is proved that, given $p\_1=2\lt p\_2=3\lt\cdots\lt p\_k$, the first $k$ primes, and a positive integer $n\le(\prod\_{i=1}^kp\_i)(\sum\_{j=1}^k1/p\_j)$, free of prime factors less than or equal to $p\_k$, there exist integers $N\_1,N\_2,\dots,N\_k$ with $$n=N\_1+N\_2+\cdots+N\_k$$ where each $|N\_j|\lt\prod\_{i=1}^kp\_i$ and the prime divisors of $N\_j$ are precisely the primes $p\_1,p\_2,\dots,p\_k$ other than $p\_j$. 


The earlier paper looked at writing $n=A\pm B$ where each prime not exceeding $\sqrt n$ divides exactly one of $A$ and $B$. 


