Ask Your Question
1

Efficiently testing probable primes

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

polistirolo gravatar image

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

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
1

answered 2019-01-24 16:26:02 +0100

tmonteil gravatar image

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

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()
False

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

Stats

Asked: 2019-01-24 14:51:16 +0100

Seen: 579 times

Last updated: Jan 24 '19