3 ms·
How on earth did they verify a 30k long number is prime?!?
by tus88 7y ago
How on earth did they verify a 30k long number is prime?!?
- peteretep 7y agoPerl's regex engine is really fast, so presumably: perl -lne '(1x$_) =~ /^1?$|^(11+?)\1+$/ || print "$_ is prime"'
- saagarjha 7y agoFor the curious: https://www.pixelstech.net/article/1324906920-A-Perl-Regular-Expression-That-Matches-Prime-Numbers https://www.pixelstech.net/article/1324906920-A-Perl-Regular...