The Greedy Harmonic Sieve and Classical Sieve Theory
Victor Geere
March 2026
Table of Contents
Abstract
The greedy harmonic decomposition of an angle \(\theta \in [0,\pi]\) produces binary selection indicators \(\delta_n(\theta) \in \{0,1\}\) that define a deterministic subset \(\mathcal{S}(\theta) \subset \{2,3,4,\ldots\}\) of the natural numbers. This paper investigates the sieve-theoretic properties of these sets. We show that \(\mathcal{S}(\theta)\) has natural density zero for all \(\theta < \pi\) but possesses a well-defined logarithmic density equal to \(\theta/\pi\), making it a natural example of a set whose logarithmic and natural densities disagree. We compare the greedy harmonic sieve with classical arithmetic sieves (Eratosthenes, Selberg, Brun), identifying both structural analogies—sequential construction, sparsity, parametric families—and fundamental differences—absence of multiplicative structure, absence of an Euler product, and a counting function of order \(\log N\) rather than \(N/\log N\). We establish a precise probabilistic model for the sieve via independent Bernoulli trials with success probability \(x/(n+2)\), show that the greedy sieve matches this model in its first moment but differs in its correlation structure, and connect the construction to the classical theory of Egyptian fractions and the Sylvester–Fibonacci algorithm. The paper concludes that the greedy harmonic sieve occupies a distinctive position: it is a non-arithmetic, geometrically motivated sieve whose density properties arise from the divergence of the harmonic series rather than from the distribution of prime numbers.
1. Setup and Recap
We recall the essential definitions from the companion paper On the Correlation Structure of a Greedy Harmonic Decomposition of the Sine Function [Geere, 2026a].
The question we address: the selection indicators \(\delta_n(\theta)\) define a deterministic "sieve" on the integers \(\{2, 3, 4, \ldots\}\). The counting function \(D(N,\theta) \sim x\ln N\) is logarithmic, superficially reminiscent of the prime counting function \(\pi(N) \sim N/\ln N\). What, if any, are the deeper connections between this greedy harmonic sieve and the classical sieves of number theory?
2. The Greedy Harmonic Sieve
- Boundary cases. \(\mathcal{S}(0) = \emptyset\) and \(\mathcal{S}(\pi) = \{2, 3, 4, \ldots\}\).
- Monotone nesting. If \(\theta_1 \leq \theta_2\) then \(\mathcal{S}(\theta_1) \subseteq \mathcal{S}(\theta_2)\). The family \(\{\mathcal{S}(\theta)\}_{\theta \in [0,\pi]}\) is a nested filtration of the positive integers \(\geq 2\).
- Infiniteness. For every \(\theta > 0\), the set \(\mathcal{S}(\theta)\) is infinite.
- Counting function. \(|\mathcal{S}(\theta) \cap [2, N]| = (\theta/\pi)\ln N + O(1)\).
(a) At \(\theta = 0\), the residual is always zero, so no index is selected. At \(\theta = \pi\), the greedy algorithm selects every index (since \(\sum \alpha_n\) diverges and the residual always exceeds the next \(\alpha_n\) until the total is exhausted).
(b) This is a restatement of selection monotonicity (Definition 1.2): if \(\delta_n(\theta_1) = 1\) then \(\delta_n(\theta_2) = 1\) for \(\theta_2 \geq \theta_1\).
(c) Since \(\alpha_n \to 0\), for any \(\theta > 0\) there are infinitely many \(n\) with \(\alpha_n < \theta\), and the greedy algorithm will eventually select infinitely many of them.
(d) The count \(|\mathcal{S}(\theta) \cap [2, N]| = D(N-2, \theta)\). By Definition 1.3, \(D(N-2, \theta) = (\theta/\pi)\ln N + O(1)\).
3. Density Properties
We now establish the density properties of the sieve set, showing that natural density and logarithmic density give qualitatively different pictures.
- Natural (asymptotic) density: \(\displaystyle d(A) = \lim_{N \to \infty} \frac{|A \cap [1,N]|}{N}\), if the limit exists.
- Logarithmic density: \(\displaystyle \delta(A) = \lim_{N \to \infty} \frac{1}{\ln N}\sum_{\substack{k \in A \\ k \leq N}} \frac{1}{k}\), if the limit exists.
| Set \(A\) | Counting function \(|A \cap [1,N]|\) | Reciprocal sum \(\sum_{k \in A, k \leq N} 1/k\) | Natural density |
|---|---|---|---|
| All integers | \(N\) | \(\sim \ln N\) | 1 |
| Primes | \(\sim N/\ln N\) | \(\sim \ln\ln N\) | 0 |
| Perfect squares | \(\sim \sqrt{N}\) | \(\to \pi^2/6\) | 0 |
| \(\mathcal{S}(\theta)\), greedy sieve | \(\sim (\theta/\pi)\ln N\) | \(\to \theta/\pi\) | 0 |
| Powers of 2 | \(\sim \log_2 N\) | \(\to 1\) | 0 |
4. A Probabilistic Comparison
To understand the greedy harmonic sieve more deeply, we compare it with the natural probabilistic model: a random subset of \(\{2,3,4,\ldots\}\) where each integer \(k\) is included independently with a prescribed probability.
4.1. Second moment and correlations
- Bernoulli model: \(\mathrm{Var}(|\mathcal{B}(x) \cap [2,N]|) = \sum_{k=2}^{N} \frac{x}{k}\left(1 - \frac{x}{k}\right) = x\ln N + O(1)\).
- Greedy model: The counting function \(D(N,\theta)\) is deterministic in \(\theta\), so its "variance" is measured by the \(\theta\)-integrated fluctuation: \[ \int_0^\pi \left[D(N,\theta) - \frac{\theta}{\pi}\ln N\right]^2 \frac{d\theta}{\pi} = O(1). \]
(a) By independence, \(\mathrm{Var}(|\mathcal{B}(x) \cap [2,N]|) = \sum p_k(1-p_k) = \sum x/k - \sum x^2/k^2 = x\ln N + O(1)\).
(b) The greedy counting function satisfies \(D(N,\theta) = (\theta/\pi)\ln N + O(1)\) uniformly in \(\theta\), so \(D(N,\theta) - (\theta/\pi)\ln N = O(1)\) for all \(\theta\). The \(\theta\)-averaged squared fluctuation is therefore \(O(1)\).
5. Comparison with Arithmetic Sieves
Classical sieve theory concerns subsets of the integers defined by divisibility conditions. We compare the greedy harmonic sieve with these arithmetic sieves to delineate the structural analogies and differences.
5.1. The Sieve of Eratosthenes
| Feature | Eratosthenes sieve | Greedy harmonic sieve |
|---|---|---|
| Mechanism | Remove multiples of small primes | Include if residual angle permits |
| Direction | Exclusionary (removes elements) | Inclusionary (adds elements) |
| Sequential order | Process primes \(2, 3, 5, 7, \ldots\) | Process integers \(2, 3, 4, 5, \ldots\) |
| Condition for survival/inclusion | Not divisible by any smaller prime | Remaining residual \(\geq \pi/k\) |
| Uses multiplicative structure | Yes (divisibility) | No |
| Counting function | \(\sim N/\ln N\) | \(\sim (\theta/\pi)\ln N\) |
| Parametric family | No (unique output: the primes) | Yes (parameterised by \(\theta \in [0,\pi]\)) |
| Reciprocal sum | Diverges (\(\sim \ln\ln N\)) | Converges (\(\to \theta/\pi\)) |
5.2. Combinatorial sieves: Brun and Selberg
- A finite set \(\mathcal{A}\) of integers (the "sifting set"), typically \(\mathcal{A} = \{n : n \leq N\}\) or \(\mathcal{A} = \{n : n \leq N,\; n \equiv a \pmod{q}\}\).
- A set of primes \(\mathcal{P}\) (the "sifting primes").
- For each prime \(p \in \mathcal{P}\) and each \(d \mid P(z) = \prod_{p \in \mathcal{P}, p < z} p\), an approximation \(|\mathcal{A}_d| \approx \frac{\omega(d)}{d} X + r_d\), where \(\mathcal{A}_d = \{a \in \mathcal{A} : d \mid a\}\), \(X = |\mathcal{A}|\), \(\omega\) is a multiplicative function, and \(r_d\) is a remainder term.
- The selection criterion \(\delta_n(\theta) = 1\) is not a divisibility condition. There is no set of "sifting primes" and no multiplicative density function \(\omega(d)\).
- The counting function \(D(N,\theta) \sim (\theta/\pi)\ln N\) does not have the form \(X \cdot \prod_{p < z}(1 - \omega(p)/p) + \text{error}\) for any choice of \(\omega\).
- In particular, \(D(N,\theta)\) grows as \(\ln N\), not as \(N \cdot (\text{product of local densities})\). No value of the sieve dimension \(\kappa\) produces this growth rate within the Brun–Selberg framework.
(a) The greedy criterion \(\theta - \theta_n \geq \alpha_n\) depends on the accumulated angle from all previous selections, not on the divisibility of \(n+2\) by any prime. Two integers with identical prime factorisations but different positions in the sequence (which cannot happen, but conceptually) would have different selection outcomes, demonstrating the non-arithmetic nature of the criterion.
(b) In the Brun–Selberg framework, the sifting function for sieve dimension \(\kappa\) satisfies \(S(\mathcal{A}, \mathcal{P}, z) \sim C \cdot N / (\ln z)^{\kappa}\) for suitable \(z\). With \(z = N\), this gives a counting function of order \(N / (\ln N)^{\kappa}\), which for \(\kappa = 1\) yields the prime number theorem. No choice of \(\kappa\) gives \(\ln N\): the expression \(N/(\ln N)^{\kappa}\) always grows polynomially in \(N\), while \(\ln N\) grows only logarithmically.
(c) The mismatch in growth rate is not a technicality but a fundamental incompatibility: the greedy harmonic sieve selects too few integers for any arithmetic sieve model.
5.3. Analogies that do hold
- Sequential construction. Both are built by processing integers in order and making local decisions (include/exclude) based on accumulated information.
- Sparsity. Both produce sets of natural density zero (for non-trivial parameter values).
- Parametric families. The greedy sieve \(\{\mathcal{S}(\theta)\}_{\theta}\) is parametric in \(\theta\), analogous to the family of sieve problems \(\{S(\mathcal{A}, \mathcal{P}, z)\}_{z}\) parametric in the sieve level \(z\).
- Monotone nesting. Increasing the parameter (\(\theta\) for the greedy sieve, \(z\) for the Eratosthenes sieve) changes the output monotonically: in the greedy sieve, \(\mathcal{S}(\theta)\) grows; in the Eratosthenes sieve, \(S(\mathcal{A}, \mathcal{P}, z)\) shrinks (more integers are sifted out as \(z\) increases).
- Harmonic series connection. The density function \(\omega(p)/p\) in sieve theory sums to \(\sim \kappa \ln\ln z\) over primes, involving the harmonic series applied to primes. The greedy sieve directly uses the harmonic series \(\sum 1/k\) applied to all integers. In both cases, the divergence of a harmonic-type series is the source of the sieve's power.
Each item is a direct comparison of the definitions. The most substantive is (e): in Mertens' theorem, \(\sum_{p \leq z} 1/p = \ln\ln z + M + O(1/\ln z)\) where \(M\) is the Meissel–Mertens constant. The sum \(\sum 1/p\) over primes plays the same structural role as \(\sum 1/k\) over all integers in the greedy sieve—both are divergent harmonic-type sums whose partial sums control the density of the sieved set.
6. Connection to Egyptian Fraction Algorithms
The greedy harmonic sieve is closely related to the classical theory of Egyptian fraction representations, providing a more natural mathematical context for the construction than sieve theory.
- The Sylvester–Fibonacci algorithm applied to \(q = \theta/\pi\) selects unit fractions \(1/a_k\) from the full set \(\{1/k : k \geq 1\}\), choosing the largest available at each step.
- The greedy harmonic sieve applied to \(\theta\) selects unit fractions from the restricted set \(\{1/k : k \geq 2\}\), but considers them in the fixed order \(k = 2, 3, 4, \ldots\) rather than in the Sylvester–Fibonacci order.
- The two algorithms produce the same output when the denominators are already in increasing order, which is the case for the harmonic sequence \(1/2, 1/3, 1/4, \ldots\)
(a) and (b) follow from the definitions. For (c): the Sylvester–Fibonacci algorithm at each step selects \(a_k = \lceil 1/q_{k-1} \rceil\), the smallest integer whose reciprocal fits. Since the greedy harmonic sieve considers integers in increasing order \(2, 3, 4, \ldots\) and selects each one if its reciprocal fits in the remaining budget, and this is exactly the same as choosing the largest available unit fraction from \(\{1/k : k \geq 2\}\)—which is \(1/a\) with \(a = \) smallest integer \(\geq 2\) such that \(1/a \leq q_{\text{remaining}}\).
Specifically: at step \(n\), the greedy harmonic sieve includes \(n+2\) iff \(\pi/(n+2) \leq r_n\) (the remaining residual), i.e., iff \(1/(n+2) \leq r_n/\pi\). This is equivalent to going through \(k = 2, 3, 4, \ldots\) in order and including \(k\) whenever \(1/k\) fits in the remaining fraction \(r_n/\pi\). Since the denominators are already sorted in increasing order (i.e., the unit fractions \(1/2, 1/3, 1/4, \ldots\) are in decreasing order), this is the Sylvester–Fibonacci algorithm restricted to \(\{1/k : k \geq 2\}\).
- For rational \(\theta/\pi\): the harmonic series has irrational partial sums (in general), so the greedy residual \(r_n\) need not reach zero in finitely many steps. Even when \(\theta/\pi\) is rational, the constraint that denominators run through \(2, 3, 4, \ldots\) without gaps means the algorithm cannot always find an exact finite representation within this restricted set.
- For irrational \(\theta/\pi\): no finite sub-sum of \(\{1/k\}\) equals \(\theta/\pi\), so the algorithm never terminates.
- When \(\theta = \pi\), \(\mathcal{S}(\pi) = \{2,3,4,\ldots\}\) has divergent reciprocal sum, so by the Erdős–Graham theorem, finite subsets summing to 1 exist.
- For \(\theta < \pi\), \(\mathcal{S}(\theta)\) has convergent reciprocal sum \(\theta/\pi < 1\), so the Erdős–Graham theorem does not apply. However, the greedy sieve can be viewed as the "partial" version of the Erdős–Graham completeness: it extracts a maximal sub-sum not exceeding \(\theta/\pi\) from the harmonic series.
(a) \(\sum_{k \geq 2} 1/k = \infty\), so the Erdős–Graham theorem applies.
(b) The greedy sieve extracts sub-sums of the harmonic series: \(\sum_{k \in \mathcal{S}(\theta)} 1/k = \theta/\pi\). By the greedy residual bound, this is the unique maximal sub-sum (in the greedy order) not exceeding \(\theta/\pi\). The construction is related to, but distinct from, the subset-sum and Egyptian fraction problems that underpin the Erdős–Graham theorem.
7. The Generating Dirichlet Series
The Dirichlet series associated with the sieve set provides a link—algebraic but not analytic—to the Riemann zeta function.
- \(\Phi(s,\theta)\) converges absolutely for \(\sigma > 1\).
- \(\Phi(s,\theta)\) converges conditionally for \(\sigma > 0\), by partial summation using the logarithmic counting function \(D(N,\theta) = O(\ln N)\).
- At the boundary values: \(\Phi(s, 0) = 0\) and \(\Phi(s, \pi) = \zeta(s) - 1\) for \(\sigma > 1\).
(a) \(|\delta_n/(n+2)^s| \leq (n+2)^{-\sigma}\), and \(\sum (n+2)^{-\sigma} < \infty\) for \(\sigma > 1\).
(b) Let \(D(N) = \sum_{n=0}^{N} \delta_n(\theta) = O(\ln N)\). By Abel summation:
\[ \sum_{n=0}^{N} \frac{\delta_n}{(n+2)^s} = \frac{D(N)}{(N+2)^s} + s\int_0^N \frac{D(u)}{(u+2)^{s+1}}\,du. \]The first term is \(O(\ln N \cdot N^{-\sigma}) \to 0\) for \(\sigma > 0\). The integral converges absolutely for \(\sigma > 0\) since \(D(u) = O(\ln u)\) and \(\int \ln u \cdot u^{-\sigma-1}\,du < \infty\) for \(\sigma > 0\).
(c) When \(\theta = 0\): \(\delta_n = 0\) for all \(n\), so \(\Phi(s,0) = 0\). When \(\theta = \pi\): \(\delta_n = 1\) for all \(n\), so \(\Phi(s,\pi) = \sum_{n=0}^{\infty}(n+2)^{-s} = \sum_{k=2}^{\infty} k^{-s} = \zeta(s) - 1\).
This fails for any \(\theta \in (0,\pi)\). For example, take \(\theta = \pi/2\). Then \(2 \in \mathcal{S}(\pi/2)\) (since \(\theta_0^* = \pi/2\) and \(\theta \geq \pi/2\)). Check whether \(3 \in \mathcal{S}(\pi/2)\): \(\theta_1^* = \pi/3 < \pi/2\), so \(3 \in \mathcal{S}(\pi/2)\). Now \(\gcd(2,3) = 1\), so multiplicativity requires \(6 \in \mathcal{S}(\pi/2)\). But the greedy sieve has a convergent reciprocal sum \(1/2\), and \(1/2 + 1/3 + 1/6 = 1 > 1/2\), so it is impossible for all three of \(2, 3, 6\) to be selected with reciprocal sum \(\leq 1/2\). Indeed, index \(n = 4\) gives \(k=6\), and by this point the accumulated angle is close to \(\pi/2\), leaving residual too small to accommodate \(\pi/6\).
Since multiplicativity of the indicator function fails, no Euler product exists.
- The sieve set \(\mathcal{S}(\theta)\) carries no multiplicative structure, and standard techniques of multiplicative number theory (Perron's formula applied to Euler products, Rankin's method, etc.) do not apply.
- The Dirichlet series \(\Phi(s,\theta)\) is a "non-multiplicative" sub-sum of \(\zeta(s) - 1\). It is an additive, not multiplicative, object.
- The analytic continuation of \(\Phi(s,\theta)\) from \(\sigma > 1\) to \(\sigma > 0\) (Proposition 7.2(b)) is via Abel summation, not via the functional equation of \(\zeta(s)\). There is no reason to expect that \(\Phi(s,\theta)\) and \(\zeta(s) - 1\) share analytic properties (such as the location of zeros) in the critical strip.
8. Discussion
8.1. Summary of findings
Our investigation of the greedy harmonic sieve in the context of classical sieve theory leads to the following conclusions:
- The sieve sets \(\mathcal{S}(\theta)\) form a nested filtration of \(\{2,3,4,\ldots\}\), parameterised by \(\theta \in [0,\pi]\), with natural density zero and convergent reciprocal sum \(\theta/\pi\) (Section 2–3).
- The relationship to the primes is superficial. The counting function \(D(N,\theta) \sim (\theta/\pi)\ln N\) grows logarithmically, but this is much slower than the prime counting function \(\sim N/\ln N\). The greedy sieve is sparser than the primes, the squares, or any set with polynomially growing counting function (Section 3).
- A Bernoulli model with probabilities \(x/k\) matches the first moment of the greedy sieve but differs in higher moments, because the greedy constraint introduces deterministic correlations (Section 4).
- The greedy sieve is fundamentally non-arithmetic. It does not fit the Brun–Selberg combinatorial sieve framework, has no sieve dimension, and the associated Dirichlet series has no Euler product (Sections 5, 7).
- The natural mathematical context is Egyptian fraction theory, not prime sieve theory. The greedy harmonic sieve is the Sylvester–Fibonacci algorithm applied to the target \(\theta/\pi\) using the restricted denominator set \(\{2,3,4,\ldots\}\) (Section 6).
- The Dirichlet series \(\Phi(s,\theta)\) interpolates between 0 and \(\zeta(s)-1\) as a step function of \(\theta\), but this interpolation is additive (one term at a time) rather than multiplicative, and the analytic properties of \(\Phi(s,\theta)\) in the critical strip are unrelated to those of \(\zeta(s)\) (Section 7).
8.2. What is genuinely shared
The one deep structural feature shared by the greedy harmonic sieve and arithmetic sieves is the role of the divergent harmonic series. In the sieve of Eratosthenes, the divergence of \(\sum 1/p\) (Euler's proof of the infinitude of primes) is the engine that drives the sieve: as the sieve level \(z \to \infty\), more and more primes contribute to the removal of composite numbers, and the divergence of \(\sum 1/p\) ensures that the surviving set (the primes) becomes sparse. In the greedy harmonic sieve, the divergence of \(\sum 1/k\) is the engine that ensures convergence: the greedy algorithm can always find another term whose reciprocal fits in the remaining budget, because the harmonic series diverges.
In both cases, the logarithmic divergence rate of the relevant harmonic sum determines the density of the output set. For primes, Mertens' theorem gives \(\prod_{p \leq z}(1-1/p) \sim e^{-\gamma}/\ln z\), leading to \(\pi(N) \sim N/\ln N\). For the greedy sieve, the partial sum \(\sum_{k=2}^{N} 1/k \sim \ln N\) directly gives the counting function \(D(N,\theta) \sim (\theta/\pi)\ln N\). Both feature the logarithm, but arising from different mechanisms: a product over primes in one case, a sum over all integers in the other.
8.3. Open problems
- Additive structure of \(\mathcal{S}(\theta)\). Do the sieve sets have any additive structure? For instance, is \(\mathcal{S}(\theta)\) a Sidon set (no two pairs share the same sum) or an asymptotic additive basis of some order? The convergent reciprocal sum suggests that sumset growth is limited.
- Distribution of gaps. What is the distribution of consecutive gaps \(g_k = s_{k+1} - s_k\) where \(s_1 < s_2 < \cdots\) are the elements of \(\mathcal{S}(\theta)\)? For primes, the gaps are conjectured to follow a Cramér-type distribution. For the greedy sieve, the gap structure is controlled by the threshold angles but has not been characterised.
- Higher-dimensional analogues. If the harmonic angles \(\pi/(n+2)\) are replaced by a different decreasing sequence \(\alpha_n\) with \(\sum \alpha_n = \infty\), the greedy algorithm still converges (by the same argument). How do the properties of the resulting sieve sets depend on the choice of \((\alpha_n)\)?
- Intersection with arithmetic sets. What is \(\mathcal{S}(\theta) \cap \mathcal{P}\), where \(\mathcal{P}\) is the set of primes? How many primes does the greedy sieve select? Since the greedy sieve selects roughly a \((\theta/\pi)\)-fraction of the harmonic sum, and the Mertens constant governs the prime contribution, the count of sieved primes should be related to \(\sum_{p \in \mathcal{S}(\theta)} 1/p\), but the precise asymptotics depend on the interplay between the prime distribution and the greedy selection rule.
References
- Croot, E. (2003). On a coloring conjecture about unit fractions. Annals of Mathematics, 157(2), 545–556.
- Erdős, P. & Graham, R.L. (1980). Old and New Problems and Results in Combinatorial Number Theory. Monographies de L'Enseignement Mathématique 28.
- Geere, V. (2020). Geometric Sine Construction. [link]
- Geere, V. (2026a). On the Correlation Structure of a Greedy Harmonic Decomposition of the Sine Function. [link]
- Geere, V. (2026b). A Harmonic Reconstruction of the Sine Function and Its Relation to the Riemann Zeta Function. [link]
- Guy, R.K. (2004). Unsolved Problems in Number Theory. 3rd ed., Springer.
- Halberstam, H. & Richert, H.-E. (1974). Sieve Methods. Academic Press.
- Hardy, G.H. & Wright, E.M. (2008). An Introduction to the Theory of Numbers. 6th ed., Oxford University Press.
- Mertens, F. (1874). Ein Beitrag zur analytischen Zahlentheorie. J. reine angew. Math., 78, 46–62.
- Sylvester, J.J. (1880). On a point in the theory of vulgar fractions. American Journal of Mathematics, 3(4), 332–335.