antiprime
    Preparing search index...

    Function isConsecutivePrimeFactors

    • Determines whether a prime factorisation uses exactly the first k primes (2, 3, 5, …), with none skipped.

      Parameters

      Returns boolean

      true if the prime factors are the first k primes; otherwise false.

      This is one of the tests every antiprime candidate passes. The empty factorisation of 1 passes trivially.

      TypeError If pf is not an array of objects with numeric factor and exponent properties.

      RangeError If pf is not a prime factorisation: ascending distinct primes with positive integer exponents.

      1.0.0

      isConsecutivePrimeFactors(primeFactors(60)); // true: 2² × 3 × 5
      isConsecutivePrimeFactors(primeFactors(10)); // false: 2 × 5 skips 3