Skip to content

primeFactors

Subhajit Sahu edited this page Aug 9, 2022 · 1 revision

Find the prime factors of a bigint.

Similar: minPrimeFactor, maxPrimeFactor, primeFactors.
Similar: properDivisors, primeFactors, primeExponentials, isPrime.


function primeFactors(x)
// x: a bigint

const xbigint = require('extra-bigint');


xbigint.primeFactors(1n);
// → []

xbigint.primeFactors(3n);
// → [3n]

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

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

xbigint.primeFactors(53n);
// → [53n]


References

Clone this wiki locally