antiprime
    Preparing search index...

    Function isAntiprimeCandidate

    • Determines whether a number is an antiprime candidate: it passes the tests that every antiprime passes.

      Parameters

      • n: number

        A non-zero safe integer.

      • Optionalpf: readonly PrimeFactor[]

        The prime factorisation of n, if already known; it is checked against n.

      Returns boolean

      true if the absolute value of n is an antiprime candidate; otherwise false.

      A candidate's prime factors are the first k primes, its exponents never increase, and its largest prime factor has an exponent of 1 (except for 4 and 36). Every antiprime is a candidate, but not every candidate is an antiprime. Negative numbers are judged by their absolute value.

      TypeError If n is not a number, or pf is not an array of prime factor objects.

      RangeError If n is zero, not an integer, or outside the safe integer range, or pf is not the prime factorisation of n.

      1.0.0

      isAntiprimeCandidate(36); // true
      isAntiprimeCandidate(30); // true, though 30 is not an antiprime
      isAntiprimeCandidate(18); // false