Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created January 21, 2017 23:57
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 zoffixznet/69fb32fde88cc74e1e69e0e8145772d3 to your computer and use it in GitHub Desktop.
Save zoffixznet/69fb32fde88cc74e1e69e0e8145772d3 to your computer and use it in GitHub Desktop.
my $sum = 0;
for (1..2015) -> $term {
$sum += $term;
my $factors = 2 * do for (1..floor(sqrt($sum))) -> $x {
$sum % $x == 0 ?? $x !! Empty
}
$factors-- if floor(sqrt($sum)) == sqrt($sum);
}
say now - INIT now;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment