diff options
Diffstat (limited to '036.pl')
-rwxr-xr-x | 036.pl | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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"; |