Determines whether a prime factorisation uses exactly the first k primes (2, 3, 5, …), with none skipped.
A prime factorisation, such as the result of primeFactors.
true if the prime factors are the first k primes; otherwise false.
true
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.
TypeError
pf
factor
exponent
RangeError If pf is not a prime factorisation: ascending distinct primes with positive integer exponents.
RangeError
1.0.0
isConsecutivePrimeFactors(primeFactors(60)); // true: 2² × 3 × 5isConsecutivePrimeFactors(primeFactors(10)); // false: 2 × 5 skips 3 Copy
isConsecutivePrimeFactors(primeFactors(60)); // true: 2² × 3 × 5isConsecutivePrimeFactors(primeFactors(10)); // false: 2 × 5 skips 3
Determines whether a prime factorisation uses exactly the first k primes (2, 3, 5, …), with none skipped.