Created
August 21, 2012 05:18
-
-
Save ichirin2501/3411947 to your computer and use it in GitHub Desktop.
Project Euler 30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use List::Util qw/sum/; | |
# (9^5) + (9^5) + (9^5) + (9^5) + (9^5) + (9^5) = 354294 | |
my @res = grep{ my $t = $_; $t == sum map{$_ ** 5} split(//,$t) } 2..354294; | |
print sum @res; | |
# => 443839 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment