SphenicNumbers
The sphenic numbers : products of three DISTINCT primes (, ).
OEIS
A007304SphenicNumbersthe for distinct primes , an infinite indexed collection.Details
- A lazy indexed collection: . OEIS A007304.
- unranks by scanning forward, factoring each candidate -- ().
- Membership goes through Element: is true, is false (, a repeated factor).
Definition
Epsil, as the implementation runs it.
count()
PositiveInfinityunrank(_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 Apply(
(fw_e: list<integer>) => fw_e[3] +
(1 if fw_e[1] > 1 else 0) ==
3 &&
fw_e[4] +
(1 if fw_e[1] > 1 &&
!(fw_e[1] == fw_e[2] &&
fw_e[5] == 1) else 0) ==
3,
Fold(
Function(fw_w if fw_w[2] * fw_w[2] >
fw_w[1] else [
fw_w[1] / fw_w[2],
fw_w[2],
fw_w[3] + 1,
fw_w[4] +
(1 - fw_w[5]),
1,
] if fw_w[1] % fw_w[2] ==
0 else [fw_w[1], fw_w[2] + 1, fw_w[3], fw_w[4], 0], fw_w, fw_i),
[sn_k, 2, 0, 0, 0],
Range(1, Floor(Sqrt(sn_k)) +
Floor(Log(sn_k, 2)) +
2, 1),
),
) else sn_s, sn_s, sn_k),
0,
Range(
1,
6 * Apply(
(pb_n: integer) => 11 if pb_n < 6 else Floor(pb_n *
(Ln(pb_n) +
Ln(Ln(pb_n)))) +
1,
_r + 1 + 2,
),
1,
),
),
)rank(_x)
Fold(Function(
sn_c + 1 if Apply(
(fw_e: list<integer>) => fw_e[3] +
(1 if fw_e[1] > 1 else 0) == 3 && fw_e[4] +
(1 if fw_e[1] >
1 &&
!(fw_e[1] ==
fw_e[2] &&
fw_e[5] ==
1) else 0) == 3,
Fold(
Function(
fw_w if fw_w[2] * fw_w[2] >
fw_w[1] else [
fw_w[1] /
fw_w[2],
fw_w[2],
fw_w[3] + 1,
fw_w[4] + (1 -
fw_w[5]),
1,
] if fw_w[1] %
fw_w[2] == 0 else [
fw_w[1],
fw_w[2] + 1,
fw_w[3],
fw_w[4],
0,
],
fw_w,
fw_i,
),
[sn_k, 2, 0, 0, 0],
Range(1, Floor(Sqrt(sn_k)) +
Floor(Log(sn_k, 2)) + 2, 1),
),
) else sn_c,
sn_c,
sn_k,
), 0, Range(1, _x - 1, 1)) if (Apply(
(fw_e: list<integer>) => fw_e[3] +
(1 if fw_e[1] > 1 else 0) == 3 &&
fw_e[4] +
(1 if fw_e[1] > 1 &&
!(fw_e[1] == fw_e[2] &&
fw_e[5] == 1) else 0) == 3,
Fold(
Function(
fw_w if fw_w[2] *
fw_w[2] >
fw_w[1] else [
fw_w[1] / fw_w[2],
fw_w[2],
fw_w[3] + 1,
fw_w[4] +
(1 - fw_w[5]),
1,
] if fw_w[1] % fw_w[2] ==
0 else [fw_w[1], fw_w[2] + 1, fw_w[3], fw_w[4], 0],
fw_w,
fw_i,
),
[_x, 2, 0, 0, 0],
Range(1, Floor(Sqrt(_x)) +
Floor(Log(
_x,
2,
)) + 2, 1),
),
) if _x >= 1 else False) else -1valid(_x)
Apply(
(fw_e: list<integer>) => fw_e[3] + (1 if fw_e[1] > 1 else 0) == 3 && fw_e[4] +
(1 if fw_e[1] > 1 &&
!(fw_e[1] == fw_e[2] &&
fw_e[5] == 1) else 0) ==
3,
Fold(
Function(
fw_w if fw_w[2] * fw_w[2] > fw_w[1] else [
fw_w[1] /
fw_w[2],
fw_w[2],
fw_w[3] + 1,
fw_w[4] + (1 -
fw_w[5]),
1,
] if fw_w[1] %
fw_w[2] == 0 else [
fw_w[1],
fw_w[2] + 1,
fw_w[3],
fw_w[4],
0,
],
fw_w,
fw_i,
),
[_x, 2, 0, 0, 0],
Range(1, Floor(Sqrt(_x)) + Floor(Log(_x, 2)) + 2, 1),
),
) if _x >= 1 else FalseEnumeration
Examples
1 more kept as data, checked against the oraclesAbout
| Examples | 1 |
|---|---|
| Crosswalk | OEIS |
See also: Count, At, Element, SquarefreeSemiprimes, KAlmostPrimes