5 ms·
A long and detailed list of prime number structures in Haskell https://wiki.haskell.org/Prime_numbers https://wiki.haskell.org/Prime_numbers And a long list o
by mrcactu5 11y ago
A long and detailed list of prime number structures in Haskell
https://wiki.haskell.org/Prime_numbers 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_Wheels 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
- tromp 11y agoThere'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.