diff options
| -rwxr-xr-x | challenge-012/jo-37/perl/ch-1.pl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/challenge-012/jo-37/perl/ch-1.pl b/challenge-012/jo-37/perl/ch-1.pl new file mode 100755 index 0000000000..d8eccb06d3 --- /dev/null +++ b/challenge-012/jo-37/perl/ch-1.pl @@ -0,0 +1,11 @@ +#!/usr/bin/perl -s + +use v5.16; +use warnings; +use bigint; +use List::Gen; +use Math::Prime::Util qw(is_prime pn_primorial); + +# Build a generator for non-prime Euclid numbers and print the first N +# thereof (Default: N = 1) +<1..>->map(sub{pn_primorial($_)+1})->filter(sub{!is_prime($_)})->say(shift||1); |
