News for hackers. Stuff that matters.
Re:Dijkstra's Prime Number Algorithm by mrcactu5 on Tuesday April 05, 2016 @05:37PM (#11434720)
A long and detailed list of prime number structures in Haskell

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

Re:Dijkstra's Prime Number Algorithm by tromp on Wednesday April 06, 2016 @12:01PM (#11439644)
There's also this obfuscated

    let f='.';o c(x:y)=x:c y;z c(x:y)=f:c y;p n='p':ap fix p(o.n)in f:f:p z
defining the `bitmap' of prime numbers

    ..pp.p.p...p.p...p.p...p.....p.p.....p...p.p...p..  ...
while avoiding arithmetic altogether.