WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

ProvablePrimeQ [n]

gives True if n is provably prime, and False otherwise.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Options  
Certificate  
PrimeQMessages  
Properties & Relations  
Possible Issues  
See Also
Tech Notes
Related Guides

ProvablePrimeQ [n]

gives True if n is provably prime, and False otherwise.

Details and Options

  • To use ProvablePrimeQ , you first need to load the Primality Proving Package using Needs ["PrimalityProving`"].
  • When ProvablePrimeQ [n] returns True , then n is prime based on the Pratt certificate of primality or the AtkinMorain certificate of primality.
  • ProvablePrimeQ should not be used as a replacement for PrimeQ , as PrimeQ is several orders of magnitude faster. Instead, use ProvablePrimeQ to certify the results of PrimeQ when needed.
  • The following options can be given:
  • "SmallPrime" 1050 lower bound for using the AtkinMorain test
    "Certificate" False whether to print a certificate
    "PollardPTest" Automatic whether to use the Pollard method
    "PollardRhoTest" Automatic whether to use the Pollard method
    "TrialDivisionLimit" Automatic number of primes to use in trial division
    "PrimeQMessages" False whether progress is to be monitored

Examples

open all close all

Basic Examples  (1)

PrimeQ indicates that 1093 is prime:

ProvablePrimeQ gives the same result, but it has generated a certificate:

Scope  (2)

ProvablePrimeQ works on arbitrarily large numbers:

ProvablePrimeQ automatically threads over lists:

Options  (2)

Certificate  (1)

Use the option "Certificate"->True to view the certificate directly:

PrimeQMessages  (1)

A random prime:

Progress messages are printed with "PrimeQMessages"->True :

Properties & Relations  (1)

Here is a random prime:

If ProvablePrimeQ has returned a result, use PrimeQCertificate to print the certificate:

With "Certificate"->True , ProvablePrimeQ repeats the AtkinMorain primality test:

Possible Issues  (1)

A certificate cannot be generated for , , or :

Tech Notes

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /