Skip to content

Instantly share code, notes, and snippets.

@yuuki
Created August 21, 2012 15:13
Show Gist options
  • Select an option

  • Save yuuki/3416407 to your computer and use it in GitHub Desktop.

Select an option

Save yuuki/3416407 to your computer and use it in GitHub Desktop.
use 5.010;
use List::Util qw(sum);
my $digit = 1;
while (10**$digit <= 9**5*$digit) { ++$digit; };
say sum(grep { my $n = $_; $n eq sum(map { $_**5 } split(//, $n)) } 2..9**5*$digit);
# => 443839
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment