Skip to content

SquarefreeSemiprimes ​

The squarefree semiprimes 6,10,14,15,21,…6, 10, 14, 15, 21, …: products of two DISTINCT primes (τ=4\tau=4, μ=+1\mu=+1).

SquarefreeSemiprimesthe n=pqn = pq for distinct primes p≠qp \ne q, an infinite indexed collection.

Domain: Collections

Details
  • A lazy indexed collection: Count(SquarefreeSemiprimes)=+∞Count(SquarefreeSemiprimes) = +\infty; the squarefree subset of SemiprimeNumbers (which also allows p2p^2). OEIS A006881.
  • At(SquarefreeSemiprimes,k)At(SquarefreeSemiprimes, k) unranks by scanning forward, factoring each candidate -- At(SquarefreeSemiprimes,1)=6At(SquarefreeSemiprimes, 1) = 6.
  • Membership goes through Element: Element(6,SquarefreeSemiprimes)Element(6, SquarefreeSemiprimes) is true (2×32 \times 3), Element(4,SquarefreeSemiprimes)Element(4, SquarefreeSemiprimes) is false (222^2, not squarefree).

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) ==
                                                                                                              2 &&
                                                                                                              fw_e[4] +
                                                                                                              (1 if fw_e[1] > 1 &&
                                                                                                                    !(fw_e[1] == fw_e[2] &&
                                                                                                                      fw_e[5] == 1) else 0) ==
                                                                                                              2,
                                                                                     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,
                    2 * Apply(
                               (pb_n: integer) => 11 if pb_n < 6 else Floor(pb_n *
                                                                            (Ln(pb_n) +
                                                                             Ln(Ln(pb_n)))) +
                                                                      1,
                               _r + 1 + 1,
                             ),
                    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) == 2 && fw_e[4] +
                                                                    (1 if fw_e[1] >
                                                                          1 &&
                                                                          !(fw_e[1] ==
                                                                            fw_e[2] &&
                                                                            fw_e[5] ==
                                                                            1) else 0) == 2,
                                  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) == 2 &&
                                                                           fw_e[4] +
                                                                           (1 if fw_e[1] > 1 &&
                                                                                 !(fw_e[1] == fw_e[2] &&
                                                                                   fw_e[5] == 1) else 0) == 2,
                                                  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) == 2 && fw_e[4] +
                                                                            (1 if fw_e[1] > 1 &&
                                                                                  !(fw_e[1] == fw_e[2] &&
                                                                                    fw_e[5] == 1) else 0) ==
                                                                            2,
       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, SemiprimeNumbers, SphenicNumbers