summaryrefslogtreecommitdiff
path: root/008/ch1_v2.pl
diff options
context:
space:
mode:
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";
+}