-
Notifications
You must be signed in to change notification settings - Fork 0
maxPrimeFactor
Subhajit Sahu edited this page Aug 8, 2022
·
1 revision
Find the greatest prime number which divides a number.
Similar: minPrimeFactor, maxPrimeFactor, primeFactors.
function maxPrimeFactor(x)
// x: a number
const xmath = require('extra-number');
xmath.maxPrimeFactor(1);
// → 0
xmath.maxPrimeFactor(3);
// → 3
xmath.maxPrimeFactor(21);
// → 7
xmath.maxPrimeFactor(55);
// → 11
xmath.maxPrimeFactor(53);
// → 53