Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/IntegerFactorization.R
Get the prime factorization of a number, n, using the Quadratic Sieve.
1 |
n |
An integer, numeric, string value, or an element of class bigz. |
First, trial division is carried out to remove small prime numbers, then a modified version of Pollard's rho algorithm that is constrained is called to quickly remove further prime numbers. Next, we check to make sure that we are not passing a perfect power to the main quadratic sieve algorithm. After removing any perfect powers, we finally call the quadratic sieve with multiple polynomials in a recursive fashion until we have completely factored our number.
Vector of class bigz
Joseph Wood
1 2 | mySemiPrime <- prod(nextprime(urand.bigz(2, 40, 17)))
quadraticSieve(mySemiPrime)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.