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,18 @@
func is_k_almost_prime(n, k) {
for (var (p, f) = (2, 0); (f < k) && (p*p <= n); ++p) {
(n /= p; ++f) while (p `divides` n)
}
n > 1 ? (f.inc == k) : (f == k)
}
{ |k|
var x = 10
say gather {
{ |i|
if (is_k_almost_prime(i, k)) {
take(i)
--x == 0 && break
}
} << 1..Inf
}
} << 1..5