Skip to content

IsPrime

Tests whether n is a prime number.

IsPrime(n)tests whether is prime.

Domain: Number theory

Details
  • A prime has no positive divisors other than 1 and itself; 1 itself is not prime.
  • Returns False unless n is provably prime -- there's no third "unknown" outcome.
  • Threads element-wise over a list argument.
  • compute-engine's IsPrime requires a positive integer and returns False for negatives.

Examples

See also: FactorInteger, NextPrime