Skip to content

SphenicNumbers ​

The sphenic numbers 30,42,66,70,78,…30, 42, 66, 70, 78, …: products of three DISTINCT primes (τ=8\tau=8, μ=−1\mu=-1).

SphenicNumbersthe n=pqrn = pqr for distinct primes p,q,rp, q, r, an infinite indexed collection.

Domain: Collections

Details
  • A lazy indexed collection: Count(SphenicNumbers)=+∞Count(SphenicNumbers) = +\infty. OEIS A007304.
  • At(SphenicNumbers,k)At(SphenicNumbers, k) unranks by scanning forward, factoring each candidate -- At(SphenicNumbers,1)=30At(SphenicNumbers, 1) = 30 (2×3×52\times3\times5).
  • Membership goes through Element: Element(30,SphenicNumbers)Element(30, SphenicNumbers) is true, Element(60,SphenicNumbers)Element(60, SphenicNumbers) is false (22×3×52^2\times3\times5, a repeated factor).

Definition

Epsil, as the implementation runs it.

count()

PositiveInfinity

unrank(_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 -1

valid(_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 False

Enumeration

Examples

1 more kept as data, checked against the oracles
About
Examples1
CrosswalkOEIS

See also: Count, At, Element, SquarefreeSemiprimes, KAlmostPrimes