Skip to content

Instantly share code, notes, and snippets.

@colomon
Created October 4, 2012 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colomon/3836214 to your computer and use it in GitHub Desktop.
Save colomon/3836214 to your computer and use it in GitHub Desktop.
my @fourth-powers = (1..*).map(* ** 4) ...^ * > 635318657;
my %counts;
for @fourth-powers X+ @fourth-powers -> $sum {
%counts{$sum}++;
}
for %counts.keys.grep({ %counts{$_} > 2 }) -> $sum {
say "$sum has { %counts{$sum} / 2 } fourth power sums";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment