Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created January 22, 2017 00:00
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/72693f839766183ddf82a0e0dafecb45 to your computer and use it in GitHub Desktop.
Save zoffixznet/72693f839766183ddf82a0e0dafecb45 to your computer and use it in GitHub Desktop.
my $sum = 0;
for (1..2015) -> $term {
$sum += $term;
my $sqr = sqrt $sum;
my $fsqr = floor sqrt $sum ;
my $factors;
$sum %% $_ and $factors +=2 for 1..$fsqr;
$factors-- if $fsqr == $sqr;
}
say now - INIT now;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment