My favourite way to test primality is:
sub is_prime { ('1' x shift) !~ /^(11+)\1+$/ }
:-)
Ted Young
($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)In reply to Re: Simple primality testing
by TedYoung
in thread Simple primality testing
by ambrus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |