RoughNumbers
The -rough numbers -- positive integers with no prime factor below -- as a lazy indexed family, one collection per (SmoothNumbers's mirror image).
RoughNumbers(k)the whose prime factors are all ( counts, vacuously), an infinite indexed collection for every .Typed signatures
| Type | Package | Applies |
|---|---|---|
(integer<0..>) -> indexed_collection<integer> | combinatorics | always |
Details
- A lazy indexed collection for each : -- every sufficiently large prime is -rough. is OEIS A007310 (coprime to 6); is A007775 (coprime to 30).
- unranks the -th match by scanning forward, factoring each candidate -- (vacuously rough).
- Membership goes through Element: is true (, both ), is false (, ).
Definition
Epsil, as the implementation runs it.
count(_k)
PositiveInfinityunrank(_k, _r)
Apply(
(sn_f: integer) => sn_f if sn_f > 0 else `NaN`,
Fold(
Function(
sn_s if sn_s > 0 else (sn_k if sn_s + _r == 0 else sn_s -
1) if Fold(
Function(ok_rf &&
sn_k % rf !=
0, ok_rf, rf),
True,
Range(2, _k - 1, 1),
) else sn_s,
sn_s,
sn_k,
),
0,
Range(
1,
Apply(
(pb_n: integer) => 11 if pb_n < 6 else Floor(pb_n *
(Ln(pb_n) +
Ln(Ln(pb_n)))) + 1,
_r + 1 + (1 if _k < 1 else _k),
),
1,
),
),
)rank(_k, _x)
Fold(Function(sn_c + 1 if Fold(
Function(ok_rf && sn_k % rf != 0, ok_rf, rf),
True,
Range(2, _k - 1, 1),
) else sn_c, sn_c, sn_k), 0, Range(1, _x - 1, 1)) if (Fold(
Function(ok_rf &&
_x % rf !=
0, ok_rf, rf),
True,
Range(2, _k - 1, 1),
) if _x >= 1 else False) else -1valid(_k, _x)
Fold(Function(ok_rf && _x % rf != 0, ok_rf, rf), True, Range(2, _k - 1, 1)) if _x >=
1 else FalseEnumeration
Examples
1 more kept as data, checked against the oraclesAbout
| Examples | 1 |
|---|
See also: Count, At, Element, SmoothNumbers, KAlmostPrimes