Skip to content

primeFactors

Subhajit Sahu edited this page Aug 8, 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 xmath = require('extra-number');


xmath.primeFactors(1);
// → []

xmath.primeFactors(3);
// → [3]

xmath.primeFactors(21);
// → [3, 7]

xmath.primeFactors(55);
// → [5, 11]

xmath.primeFactors(53);
// → [53]


References

Clone this wiki locally