sub is_prime (Int $n) { $n % all(2 .. sqrt($n)+1); } [download]
Credit: Autrijus in the Apocalypse Now talk.
In reply to Re: Simple primality testing by gaal in thread Simple primality testing by ambrus