Ask Your Question

Efficiently testing probable primes

asked 2019-01-24 14:51:16 +0200

polistirolo gravatar image

updated 2019-01-24 21:24:19 +0200

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 16:26:02 +0200

tmonteil gravatar image

updated 2019-01-24 16:26:37 +0200

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 14:51:16 +0200

Seen: 519 times

Last updated: Jan 24 '19