summaryrefslogtreecommitdiffstats
path: root/036.pl
diff options
context:
space:
mode:
Diffstat (limited to '036.pl')
-rwxr-xr-x036.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/036.pl b/036.pl
new file mode 100755
index 0000000..8d9fa27
--- /dev/null
+++ b/036.pl
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+my $total = 0;
+for my $n (1..1e6) {
+ my $n2 = sprintf "%b", $n;
+ $total += $n if $n eq reverse($n) and $n2 eq reverse($n2);
+}
+print "$total\n";