Ask Your Question
1

Efficiently testing probable primes

asked 6 years ago

polistirolo gravatar image

updated 6 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 6 years ago

tmonteil gravatar image

updated 6 years ago

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.

Preview: (hide)
link

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: 6 years ago

Seen: 634 times

Last updated: Jan 24 '19