Mariam Muayad S. Dawood Al-Samaraee
1. Executive Summary
This report provides scientific documentation of a novel mathematical and algorithmic development in the field of prime number generation. Traditional systems in this field rely on the well-known hexagonal pattern 6k±1, which has a mathematical limitation: it excludes the first prime numbers (2 and 3). As a result of this limitation, traditional algorithms are forced to isolate these two numbers into a separate set, and actual generation begins from the number 5 onwards. The researcher has successfully developed a new mathematical formulation that integrates the numbers (2 and 3) into the core hexagonal generation pattern using a "Mathematical Shift" technique. This modification entirely eliminates the need for separate sets, thus providing a unified and more efficient algorithmic solution.
2. The Developed Mathematical Equation
The new equation developed to generate prime candidates (starting from the number 2) is:
F(n) = 6 * ⌊ (n-2) / 2 ⌋ + (-1)^(n-2)
(where n belongs to positive integers: 1, 2, 3...)
Based on this equation, the set of prime numbers (M) is defined as:
M = { F(n) : n ∈ N+ , B(F(n)) = 1 }
(where B(x) is a verification function that returns 1 if the number is prime, and 0 if it is composite).
3. Mechanism of Operation and Mathematical Proof
The new equation applies a shift to the index by 2 (i.e., n-2), which allows the function to generate the first prime numbers directly. By applying the equation, we find that the index n=1 yields the number 2, the index n=2 yields the number 3, while the index n=3 yields the number 5, and n=4 yields the number 7. To ensure the accuracy of the function, the validity of the outputs was verified using the "Trial Division" algorithm. For example, to prove that the output 29 is a prime number, divisibility is tested against all integers up to the square root of the number (5.38). Since the remainder of the division does not equal zero for any of these numbers, the verification function returns the value 1, confirming the primality of the number.
4. Technical Significance and Innovation
This modification is classified as a true "Algorithmic Optimization." The significance of this innovation lies in mathematical unification, as it eliminates the need to define separate sets for the numbers 2 and 3 at the beginning of any programming code. Additionally, the new equation significantly reduces programming complexity, as it allows for writing a single iterative loop (Loop) starting from the number 1 that generates all prime numbers without the need for exceptional conditional statements (If-Statements). This leads to improved speed in initial data processing and reduced memory consumption in algorithms relying on this equation.
5. Declaration of Intellectual Property
This report constitutes an official scientific document that establishes the precedence of the discovery and development (Prior Art), and preserves the moral and scientific rights of the researcher Mariam Muayad S. Dawood Al-Samaraee prior to engaging in any academic discussions or filing for patents. All equations and mathematical formulations contained in this text are the exclusive intellectual property of the researcher named above.
Added Value in Computer Science
Reduction of Cyclomatic Complexity
In programming languages, using conditional statements (If-Statements) to handle special cases (such as the numbers 2 and 3) increases code complexity. The development of the new equation eliminates the need for these exceptional conditions at the beginning of the algorithm. This means the programming code will be free of logical branching, making it cleaner, easier to read, and less prone to bugs.
Optimization of Runtime Efficiency
When a programmer writes a prime number generation algorithm using the traditional method, the code is forced to execute an exception handling process at the start of execution to add the numbers 2 and 3. The new equation allows the iterative loop to start directly from the number 1 to generate all numbers without interruption. This reduces the number of CPU instructions executed by the processor and saves a portion of processing time (Time Complexity).
Elimination of Edge Cases
In software engineering, edge cases (such as handling the first number in a sequence) pose a burden on the programmer when writing unit tests. Since the new equation generates numbers from the beginning (2, 3, 5...) using the same mathematical pattern, it provides a uniform pattern that makes testing and documenting the algorithm much easier.
Enhancement of Scalability
Code that relies on a single continuous equation is more scalable when dealing with massive numbers. Instead of dividing the code into parts (a part for the small numbers 2 and 3, and a part for the large numbers), the new equation works as a single homogeneous block. This facilitates its integration into programming libraries and large systems that require continuous mathematical processing without interruption.
Reduction of Memory Footprint
In traditional algorithms, memory space is allocated to create a separate set 3(Set or Array). The new equation eliminates this need, as numbers are derived mathematically without the need to pre-store them in memory. This reduces the memory footprint of the program, which is crucial in resource-constrained programming environments (such as embedded systems or applications running on mobile phones).
Conclusion
In summary, this development does not merely provide a new mathematical equation; it provides a more elegant programming pattern. It transforms the algorithm from "exception-based programming" to "unified mathematical flow programming," which is what professional programmers always strive for.
*Researcher: Mariam Muayad S. Dawood Al-Samaraee
The Turkish Ministry of the Interior Foreigner Identification Number (Yabancı Kimlik Numarası or YKN): 99400518444
Educational Institution: Kırmızı Çizgi Koleji (9th Grade) - Antalya, Turkey
Date of Scientific Documentation: December 4, 2026