Ask Your Question

Efficiently testing probable primes

asked 2019-01-24 07:51:16 -0500

polistirolo gravatar image

updated 2019-01-24 14:24:19 -0500

tmonteil gravatar image

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-01-24 09:26:02 -0500

tmonteil gravatar image

updated 2019-01-24 09:26:37 -0500

There is the is_pseudo_prime method that uses PARI's Baillie-PSW probabilistic primality test:

sage: z = 2^100000-1
sage: z.is_pseudoprime()

PARI is written in C.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-01-24 07:51:16 -0500

Seen: 129 times

Last updated: Jan 24 '19