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