-
Notifications
You must be signed in to change notification settings - Fork 0
primeFactors
Subhajit Sahu edited this page Aug 9, 2022
·
1 revision
Find the prime factors of a number.
Similar: minPrimeFactor, maxPrimeFactor, primeFactors.
Similar: properDivisors, primeFactors, primeExponentials, isPrime.
function primeFactors(x)
// x: a number
const xnumber = require('extra-number');
xnumber.primeFactors(1);
// → []
xnumber.primeFactors(3);
// → [3]
xnumber.primeFactors(21);
// → [3, 7]
xnumber.primeFactors(55);
// → [5, 11]
xnumber.primeFactors(53);
// → [53]