1
0
www.mikescher.com/www/statics/euler/Euler_Problem-058_explanation.md

4 lines
416 B
Markdown
Raw Normal View History

2017-11-08 17:39:50 +01:00
It's obvious that the bottleneck of this program is the primality test.
The numbers become here too big to create a sieve and "normal" prime testing takes too long.
2018-02-03 18:45:51 +01:00
So we use the [Miller-Rabin primality test](https://en.wikipedia.org/wiki/Miller-Rabin_primality_test) that I implemented a while ago (thank [mathblog.dk](http://www.mathblog.dk)).
2017-11-08 17:39:50 +01:00
The rest is just enumerating all the diagonals until `primes*10<all`