Skip to content

Instantly share code, notes, and snippets.

@brunoV
Created November 24, 2009 15:59
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 brunoV/241968 to your computer and use it in GitHub Desktop.
Save brunoV/241968 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use Modern::Perl;
use Math::Primality 'next_prime';
my $prime = 2;
my $sum;
while ( $prime < 2_000_000 ) {
$sum += $prime;
$prime = next_prime($prime);
}
say $sum;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment