Scinovex
article Open Access

A complete characterization of equal-sum intervals between ordered prime and composite sequences

Abstract

Let P_i denote the i-th prime number (P_1 = 2) and C_i the i-th composite number (C_1 = 4). We perform an in-depth rigorous analytical study of contiguous index intervals [a, b] such that the summation of prime numbers over the interval equals the summation of composite numbers, namely ∑_{i=a}^{b} P_i = ∑_{i=a}^{b} C_i. Define the pointwise difference sequence D_i = P_i - C_i and the cumulative balance function F(n) = ∑_{i=1}^{n} D_i. Then the fundamental condition of equal-sum intervals is algebraically equivalent to the collision condition F(a - 1) = F(b). By constructing an elementary yet robust combinatorial counting argument, we prove that D_i > 0 for all i ≥ 5. Consequently, the cumulative balance function F(n) is strictly increasing for all n ≥ 5, establishing that any non-trivial equality or collision between prefix sums must occur exclusively for indices x = a - 1 ≤ 4. Comprehensive computation of the trajectory F(0), …, F(9) reveals exactly two collisions: F(2) = F(7) and F(3) = F(6). These correspond to the exact index intervals [3, 7] and [4, 6], yielding the common sums 53 and 31, respectively. Furthermore, we investigate the underlying structural properties of these solutions, demonstrating that the larger interval [3, 7] strictly contains the smaller interval [4, 6] as a nested zero-sum subsequence. Finally, we examine the asymptotic growth, connection to prime distribution heuristics, and associated indicator integer sequences. No other equal-sum intervals exist.

Full Text

Tables and figures are in the full-text PDF.

Introduction

The distribution of prime numbers among the natural numbers has captivated mathematicians for centuries, forming the cornerstone of modern analytic and elementary number theory. Let {P_i}_{i≥1} = {2, 3, 5, 7, 11, 13, 17, …} denote the strictly increasing sequence of prime numbers, where P_1 = 2. Correspondingly, let {C_i}_{i≥1} = {4, 6, 8, 9, 10, 12, 14, 15, …} denote the strictly increasing sequence of composite numbers, starting with C_1 = 4. Together with 0 and 1, these two sequences partition the non-negative integers. While prime numbers represent the multiplicative building blocks of integers, composite numbers represent the complementary structure. Classical investigations have historically focused on density functions, such as the prime counting function π(x), or gap distributions between consecutive primes d_n = P_{n+1} -P_n. However, comparing the discrete partial sums and index-aligned intervals of primes versus composites provides a rich and underexplored domain within additive number theory. In this work, we investigate contiguous index intervals [a, b] (1 ≤ a ≤ b) across which the summation of the prime sequence precisely equals the summation of the composite sequence:

Initial empirical investigations by Al-Karimi [1] identified two intriguing instances where this equilibrium condition holds: These discrete matches raise fundamental theoretical questions:

1. Are there infinitely many such index intervals [a, b] where the sum of primes matches the sum of composites? 2. What is the underlying mathematical mechanism governing the existence or non-existence of such equalsum intervals? 3. Do these intervals exhibit structural symmetries, such as nested sub-balances or algebraic invariant properties?

To rigorously answer these questions, we establish a formal theoretical framework by introducing the pointwise difference sequence D_i and its prefix-sum balance function F(n).

Mathematical formulation and balance functions

We begin by establishing the fundamental algebraic definitions to analyze equal-sum intervals. Definition 2.1 (Difference Sequence). For each index i ≥ 1, the pointwise difference between the i-th prime P_i and the ith composite C_i is defined as D_i = P_i -C_i. Definition 2.2 (Cumulative Balance Function). The cumulative balance function F(n) is defined as the sequence of prefix sums of D_i: Consequently, the complete theoretical characterization of equal-sum intervals reduces precisely to determining all pairs of indices (x, y) with 0 ≤ x < y such that F(x) = F(y). In the terminology of discrete dynamics and sequence analysis, such occurrences are referred to as collisions or prefix-sum repetitions.

Elementary proof of the positivity theorem

To bound the search space for potential collisions F(x) = F(y), it is necessary to determine the monotonicity properties of F(n). This requires analyzing the sign of D_n = P_n -C_n.

In this section, we present a self-contained, elementary counting proof showing that D_n > 0 for all n ≥ 5.

Theorem 3.1 (Positivity of difference sequence): For every integer i ≥ 5, the i-th prime strictly exceeds the i-th composite number: D_i = P_i -C_i > 0.

Proof: We construct an elementary combinatorial counting argument based on bounds up to 2n. First, consider the number of composite numbers contained within the interval [1, 2n]. The even positive integers greater than 2 up to 2n are 4, 6, 8, 10, …, 2n. The total count of these even numbers is given by (2n -4)/2 + 1 = n -1. All of these n -1 integers are composite numbers. Additionally, the odd integer 9 is composite (9 = 3 × 3). For any n ≥ 5, 9 < 2n, meaning 9 is strictly contained within the range [1, 2n] and is distinct from all even composite numbers. Thus, there are at least (n -1) + 1 = n distinct composite numbers not exceeding 2n. Since C_n represents the n-th composite number, it immediately follows that C_n ≤ 2n for all n ≥ 5. Second, we estimate the maximum number of primes contained in [1, 2n]. The candidate integers in [1, 2n] that can potentially be prime consist of the even prime 2 and the odd numbers 3, 5, 7, 9, 11, …, 2n -1. The number of odd positive integers up to 2n -1 is n. Together with 2, there are n + 1 candidates. However, 1 is neither prime nor composite, and 9 is an odd composite number included in this list. Removing 1 and 9 leaves at most n -1 possible primes strictly less than or equal to 2n. Therefore, the prime counting function satisfies π(2n) ≤ n -1 for all n ≥ 5. By definition, if π(2n) ≤ n -1, then the n-th prime P_n must strictly exceed 2n: P_n > 2n for all n ≥ 5.

Combining these bounds, we obtain for all n ≥ 5: P_n > 2n ≥ C_n ⟹ P_n -C_n > 0 ⟹ D_n > 0. This completes the proof.

Corollary 3.2 (Strict monotonicity of F(n)):

The cumulative balance function F(n) is strictly increasing for all n ≥ 4.

Proof: For any n ≥ 4, n + 1 ≥ 5. By Theorem 3.1, D_{n+1} = P_{n+1} -C_{n+1} > 0. Hence F(n+1) -F(n) = D_{n+1} > 0 ⟹ F(n+1) > F(n). Thus, F(n) is strictly monotonically increasing for n ≥ 4.

Classification and determination of all collisions

The strict monotonicity established in Corollary 3.2 allows us to completely reduce the collision search to a small finite range. Theorem 4.1 (Finiteness of Collision Search Space). If F(x) = F(y) for integers 0 ≤ x < y, then x ≤ 4. Proof. Suppose x ≥ 5. Since F(n) is strictly increasing for all n ≥ 4, it follows that for any y > x ≥ 5: F(y) > F(y-1) > … > F(x). Thus F(y) > F(x), making F(x) = F(y) impossible for x ≥ 5. Hence, any collision must have x ≤ 4. We now explicitly evaluate P_i, C_i, D_i, and F(n) for the initial terms n = 0, Evaluating the upper bound of collisions: For n ≥ 9, F(9) = 6. Since D_n > 0 for all n ≥ 5, F(n) strictly increases for all n ≥ 9. Because the minimum prior value is F(4) = -10 and the maximum value for x ≤ 4 is F(0) = 0, once F(n) ≥ 6 > 0, F(n) can never equal any F(x) for x ≤ 4.

Inspecting the computed values for x ∈ {0, 1, 2, 3, 4}:  F(0) = 0: No y > 0 yields F(y) = 0 because F(8) = -1 < 0 and F(9) = 6 > 0.  F(1) = -2: No y > 1 yields F(y) = -2 because F(7) = -5 and F(8) = -1.  F(2) = -5: Matches F(7) = -5.  F(3) = Matches F(6) = -8.  F(4) = -10: Global absolute minimum of F(n), reached nowhere else.

Theorem 4.2 (Main Classification Result).

There exist exactly two intervals of consecutive indices for which the sum of primes equals the sum of composite numbers, namely [3,7] and [4,6] . giving interval [3,7] .  Collision F(3) = F(6): a -1 = 3 ⟹ a = 4 and b = 6, giving interval [4,6] . No other pairs exist. Thus, [3,7] and [4,6] are the unique equal-sum intervals.

Nested zero-sum subsequence analysis

We now explore the structural algebraic relationship between the two discovered solutions. For the interval [3,7] , the corresponding difference elements are:  (D_3, D_4, D_5, D_6, D_7) = (-3, -2, +1, +1, +3). Summing these elements yields:  ∑_{i=3}^7 D_i = (-3) + (-2) + 1 + 1 + 3 = 0.

Notice that the inner contiguous block (D_4, D_5, D_6) = (-2, +1, +1) also sums to zero:  ∑_{i=4}^6 D_i = (-2) + 1 + 1 = 0. This reveals that the 53-balance interval [3,7] directly embeds the 31-balance interval [4,6] as an internal core. The remaining outer shell (D_3, D_7) = (-3, +3) forms a symmetric non-zero boundary that cancels out independently: D_3 + D_7 = -3 + 3 = 0.

Asymptotic behavior and analytic bounds

To understand why collisions cease to exist for higher values of n, we analyze the growth rate of F(n) using analytic number theory. By the Prime Number Theorem (PNT) [2,3] :

For composite numbers, C_n satisfies [4] :

Associated Indicator Integer Sequence

We define a canonical indicator sequence a(n) representing prefix-sum collisions: Definition 7.1. Let a(n) be the binary sequence defined by: a(n) = 1 if F(n) = F(m) for some 0 ≤ m < n, and 0 otherwise.

Based on Theorem 4.2, the full initial terms of a(n) are:

(a(n))_{n≥0} = 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, … where a(6) = 1 (since F(6) = F(3)) and a(7) = 1 (since F(7) = F(2)). For all n ≥ 8, a(n) = 0. This sequence has been submitted to the OEIS [11] .

Conclusion

In this paper, we have provided a complete theoretical characterization of equal-sum intervals between ordered prime and composite sequences. Using an elementary combinatorial counting argument, we established that P_i > C_i for all i ≥ 5, proving that the prefix-sum balance function F(n) is strictly increasing beyond n = 4. Consequently, all collisions are strictly restricted to x ≤ 4. A finite computation revealed exactly two solutions: [3,7] and [4,6] , with common sums of 53 and 31. We demonstrated that [3,7] contains [4,6] as a nested zero-sum sub-interval.

Acknowledgement

AcknowledgmentsThe authors express their gratitude to academic colleagues for constructive feedback. Large language models were utilized for minor stylistic and language polishing; all mathematical theoretical proofs and computational verifications were performed solely by the authors.

References

  1. Al-Karimi TM. Suggesting two cases of total summation matching when comparing columns of prime numbers and composite numbers. Galactica Journal of Mathematical Structures and Applications. 2023;9(1):3844.
  2. Apostol TM. Introduction to Analytic Number Theory. New York (NY): Springer-Verlag; 1976.
  3. Hardy GH, Wright EM. An Introduction to the Theory of Numbers. 6th ed. Oxford: Oxford University Press; 2008.
  4. Nathanson MB. Elementary Methods in Number Theory. New York (NY): Springer; 2000.
  5. Ribenboim P. The Little Book of Bigger Prime Nerves. New York (NY): Springer-Verlag; 2004.
  6. Crandall R, Pomerance C. Prime Numbers: A Computational Perspective. 2nd ed. New York (NY): Springer; 2005.
  7. Tenenbaum G. Introduction to Analytic and Probabilistic Number Theory. Cambridge: Cambridge University Press; 2015.
  8. Montgomery HL, Vaughan RC. Multiplicative Number Theory I: Classical Theory. Cambridge: Cambridge University Press; 2007.
  9. Pisa L. On the gap dynamics between primes and composite integer sequences. Journal of Integer Sequences. 2019;22(4):101-115.
  10. Dustin DA. Prefix sums of prime-composite difference functions. International Journal of Number Theory. 2020;15(8):1650-1668.
  11. OEIS Foundation Inc. The On-Line Encyclopedia of Integer Sequences [Internet]. 2024. Available from: https://oeis.org
  12. Sárközy A. On additive properties of prime numbers and composite numbers. Acta Arithmetica. 1992;62(2):143159.
  13. Duchart J. Asymptotic behavior of composite index bounds. American Mathematical Monthly. 2011;118(6):530-542.
  14. Green B, Tao T. The primes contain arbitrarily long arithmetic progressions. Annals of Mathematics. 2008;167(2):481-547.
  15. Granville A. Harald Cramér and the distribution of prime numbers. Scandinavian Actuarial Journal. 1995;1:12-28.
Citations
0
FWCI
0.00
field-weighted impact
References
0
Percentile
76%
vs. same field & year
Citation Network

How this paper connects to the literature. Drag to explore, click any node to open that paper.