diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2022-01-04 21:59:53 +0000 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2022-01-04 21:59:53 +0000 |
| commit | af32440afeb5e13f3b57b154ba27cfba2efd4fce (patch) | |
| tree | b44911f8b5bbfd05603d66e2787bc90297a7a511 /challenge-146 | |
| parent | cfb5851065ef019a1c2415bc376f255a8de11f58 (diff) | |
| download | perlweeklychallenge-club-af32440afeb5e13f3b57b154ba27cfba2efd4fce.tar.gz perlweeklychallenge-club-af32440afeb5e13f3b57b154ba27cfba2efd4fce.tar.bz2 perlweeklychallenge-club-af32440afeb5e13f3b57b154ba27cfba2efd4fce.zip | |
- Added solution by Robert DiCicco.
Diffstat (limited to 'challenge-146')
| -rw-r--r-- | challenge-146/robert-dicicco/perl/ch-1.pl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/challenge-146/robert-dicicco/perl/ch-1.pl b/challenge-146/robert-dicicco/perl/ch-1.pl new file mode 100644 index 0000000000..5f1dbc87e4 --- /dev/null +++ b/challenge-146/robert-dicicco/perl/ch-1.pl @@ -0,0 +1,25 @@ +#!perl.exe + +use strict; +use warnings; +use ntheory qw/ next_prime /; + +### AUTHOR: Robert DiCicco +### DATE: 04-JAN-2022 +### Challenge #145 10001st Prime + +my $cnt = 0; +my $i = 1; + +my $TARGET = 10001; + +while($cnt <= $TARGET){ + if($cnt == $TARGET ){ + last; + } + + $cnt++; + $i = next_prime($i); +} + +print("Count = $cnt : prime = $i\n"); |
