(Replying to PARENT post)
https://www.quora.com/Is-there-a-prime-between-every-natural...
(Replying to PARENT post)
Each prime generates a spacing sequence to find future primes, each prime is effectively casting a new periodic wave function. 2 produces a wave that hits all even numbers. 3 produces a wave that hits every 6 numbers (2 already gets everything else.) 5 does every {20,10}, etc...
You can see the process of generating the sieve waveform, or more technically, the prime gaps, here:
http://math.stackexchange.com/questions/311610/modified-eule...
Look at the 2nd answer, it explains the process. Remember, all prime numbers do, is cast a waveform onto the existing sieve waveform. Just chaotic interference. Division as an immediate reaction to primes is moreso because primes are taught pretty poorly. As mystic nuggets. Rather than chaotic interference.
(Replying to PARENT post)
(Replying to PARENT post)
http://www.kylem.net/stuff/sieve_eratosthenes.html
I don't completely understand it yet, but I think the Dijkstra version might have optimized the structure which contains the multiples of known primes, where I just put it into a dictionary.
* I initially saw it in a paper about how the Sieve is generally implemented incorrectly in Haskell, but I made a small Python generator implementation.
(Replying to PARENT post)
https://wiki.haskell.org/Prime_numbers
And a long list of algorithms. Many of which are surprising and probably not that efficient. The first few are:
https://wiki.haskell.org/Prime_numbers_miscellaneous#Prime_W...
Efficiency is kind of a relative issue, since you don't know the job beforehand or which one would be optimal
(Replying to PARENT post)
The same holds for the Sieve of Eratosthenes [1]
[1] https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes