Compute prime factors using Pollard's rho algorithm.
npm install @japan-d2/rho
or
yarn add @japan-d2/rho
import rho from '@japan-d2/rho'
console.log(rho(451341))
[3, 3, 11, 47, 97]
Returns the prime factors of n
sorted in ascending order.
import rho from '@japan-d2/rho/lib/bigint'
console.log(rho(451341n))
[3n, 3n, 11n, 47n, 97n]
Returns the prime factors of n
sorted in ascending order.
MIT