Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,4 @@
use ntheory "is_semiprime";
for ([1..100], [1675..1681], [2,4,99,100,1679,5030,32768,1234567,9876543,900660121]) {
print join(" ",grep { is_semiprime($_) } @$_),"\n";
}

View file

@ -0,0 +1,2 @@
use ntheory "factor";
print join(" ", grep { scalar factor($_) == 2 } 1..100),"\n";

View file

@ -0,0 +1,9 @@
use ntheory qw/factor is_prime trial_factor/;
sub issemi {
my $n = shift;
if ((my @p = trial_factor($n,500)) > 1) {
return 0 if @p > 2;
return !!is_prime($p[1]) if @p == 2;
}
2 == factor($n);
}