ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 24 Jan 2019 09:26:02 -0600Efficiently testing probable primeshttps://ask.sagemath.org/question/45168/efficiently-testing-probable-primes/I have to test extremely huge numbers (100k+ digits) in a reasonable time if they are probable primes. Are there codes for doing that? Are there C-codes interfaced with SAGE? Or something else?Thu, 24 Jan 2019 07:51:16 -0600https://ask.sagemath.org/question/45168/efficiently-testing-probable-primes/Answer by tmonteil for <p>I have to test extremely huge numbers (100k+ digits) in a reasonable time if they are probable primes. Are there codes for doing that? Are there C-codes interfaced with SAGE? Or something else?</p>
https://ask.sagemath.org/question/45168/efficiently-testing-probable-primes/?answer=45169#post-id-45169There is the `is_pseudo_prime` method that uses PARI's Baillie-PSW probabilistic primality test:
sage: z = 2^100000-1
sage: z.is_pseudoprime()
False
PARI is written in C.Thu, 24 Jan 2019 09:26:02 -0600https://ask.sagemath.org/question/45168/efficiently-testing-probable-primes/?answer=45169#post-id-45169