summaryrefslogtreecommitdiff
path: root/008/ch1_v2.pl
diff options
context:
space:
mode:
authorGuillermo Ramos2019-05-19 16:43:56 +0200
committerGuillermo Ramos2019-05-19 16:51:42 +0200
commit1cb63654f2c308f40b500b3f66fb3c1286aaa428 (patch)
tree4b86030e3ae76f711a41297786067ad811c49be7 /008/ch1_v2.pl
parent76826f342c29635483cb6b2e6faded58d5fffbd4 (diff)
downloadperlweekly-1cb63654f2c308f40b500b3f66fb3c1286aaa428.tar.gz
[008#1] Split into two versions
Diffstat (limited to '008/ch1_v2.pl')
-rwxr-xr-x008/ch1_v2.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/008/ch1_v2.pl b/008/ch1_v2.pl
new file mode 100755
index 0000000..d5c807e
--- /dev/null
+++ b/008/ch1_v2.pl
@@ -0,0 +1,10 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+my @mersenne_exps = (2, 3, 5, 7, 13);
+
+foreach my $exp (@mersenne_exps) {
+ print 2**($exp - 1) * (2**$exp - 1), "\n";
+}