# Why Divisors[ ] is far faster than Factorinteger[ ]?

Posted 9 days ago
171 Views
|
5 Replies
|
5 Total Likes
|
 Hi there, anyone can tell me what are the codes behind the command "Divisors", how it is intrinsically done? I mean what is the algorithm behind it? does it use a command solve for the different modulus that equals zero as the remainder? Why is it not used to give a PrimeQ statement if it is so fast? I mean if there is only one divisor other than the number that is being divided itself isn't a prime? I am just curious about the logics behind this intriguing command...thank you anyway.
5 Replies
Sort By:
Posted 9 days ago
 What makes you think that Divisors is faster than PrimeQ? Perhaps it is faster for small number (103 or so).But for large numbers PrimeQ is quite a bit faster than divisors (e.g. PrimeQ[418763839831824213]).
Posted 9 days ago
 I am working with prime numbers I found a way for really huge numbers far faster than prime q, and I have checked against prime Q, it gives a right answer for seven out of 8 ... I am improving it ...just tried divisors and it works for numbers with 77 digits really fast I just wondered why divisors can not be improved so I wanted to know how it works in the core...thank you.
Posted 9 days ago
 For many digits the validity of the prime-testing method is anyhow questionable. They are only valid (proven valid) up to some number.Divisors is a kernel function: Needs["GeneralUtilities"] PrintDefinitions[Divisors] `so only the developers can tell you really how it works internally…