Method on @sym: isprime (n)

Return true if a symbolic number is prime.

Example:

n = sym(127);
m = 2^n - 1
  ⇒ m = (sym) 170141183460469231731687303715884105727
isprime(m)
  ⇒ ans =  1

Example:

syms q negative
isprime(q)
  ⇒ ans =  0

See also: @sym/nextprime, @sym/prevprime.

Package: symbolic