This draft's references do not show that the subject meets Wikipedia's criteria for inclusion. The draft requires multiple published secondary sources that:
Where to get help
How to improve a draft
You can also browse Wikipedia:Featured articles and Wikipedia:Good articles to find examples of Wikipedia's best writing on topics similar to your proposed article. Improving your odds of a speedy review To improve your odds of a faster review, tag your draft with relevant WikiProject tags using the button below. This will let reviewers know a new draft has been submitted in their area of interest. For instance, if you wrote about a female astronomer, you would want to add the Biography, Astronomy, and Women scientists tags. Editor resources
|
| This is a draft article. It is a work in progress open to editing by anyone. Please ensure core content policies are met before publishing it as a live Wikipedia article. Find sources: Google (books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL Last edited by Dan arndt (talk | contribs) 4 months ago. (Update)
Finished drafting? or |
| Class | Prime sieve |
|---|
Overview
editThe Ripple Sieve is a prime sieve algorithm that generates all odd prime numbers up to a given limit n. Developed by Rayan Ivaturi, the algorithm is a variant of the Sieve of Eratosthenes that optimises the sieving process by focusing exclusively on odd integers and utilising a dynamic quadratic increment, referred to as a "ripple," to identify composite numbers.
Mathematical Recognition
editThe mathematical properties of the Ripple Sieve were formally recognised in 2017 with the acceptance of sequence (sequence A281813 in the OEIS) as ripple sequence (ripple numbers) in the Online Encyclopedia of Integer Sequences (OEIS). The sequence defines the number of "ripple" operations required for the first n odd numbers, providing a basis for analysing the algorithm's efficiency and computational density.
Algorithm Description
editFor any given positive integer n, this Ripple Sieve algorithm produces all the odd primes below n. The Ripple Sieve utilises a "seed" value to initialise a "ripple" that grows linearly, creating a second-order arithmetic progression. The seed value starts at 1 and is incremented by 2 to produce odd number seeds up till the seed value reaches the limit (n - 6) / 3.
Iterative Logic
editFor seed s, starting from 1 incremented by 2, the algorithm initialises:
- An initial base ripple: ripple = 2 * seed + 6
- A starting index: sum = seed + ripple
In each step of the inner loop, the ripple is incremented by 8, and the next composite is found by adding this new ripple to the current sum. This ensures that the algorithm only marks odd composite numbers, effectively skipping even integers.
Comparison with Sieve of Sundaram
editWhile both the Sieve of Sundaram and the Ripple Sieve aim to exclude even numbers, their implementations are mathematically distinct:
- Sieve of Sundaram: Relies on the algebraic identity i + j + 2ij to mark indices in a reduced array.
- Ripple Sieve: Operates on the values themselves using a second-order difference of 8 to skip even multiples.
Implementation
editThe following is the original implementation in Python:
def ripple_sieve(n):
primes = [False] * n
seed_limit = (n - 6) // 3
for seed in range(1, seed_limit, 2):
ripple = 2 * seed + 6
sum_val = seed + ripple
while sum_val < n:
primes[sum_val] = True
ripple += 8
sum_val += ripple
return [i for i in range(3, n, 2) if not primes[i]]
See also
editReferences
edit- Ivaturi, Rayan. Sequence A281813, The Online Encyclopedia of Integer Sequences (2017).

- Reliable sources include: reputable newspapers, magazines, academic journals, and books from respected publishers.
- Unacceptable sources include: personal blogs, social media, predatory publishers, most tabloids, and websites where anyone can contribute.
Replace any unreliable sources with high-quality sources. If you cannot find a reliable source for the material, it should be removed.