### The Maxima on-line user's manual

Algebra Calculator

#### Primep

Function: primep (<n>) Primality test. If `primep (<n>)` returns `false`, <n> is a composite number and if it returns `true`, <n> is a prime number with very high probability.

For <n> less than 341550071728321 a deterministic version of Miller-Rabins test is used. If `primep (<n>)` returns `true`, then <n> is a prime number.

For <n> bigger than 341550071728321 `primep` uses `primep_number_of_tests` Miller-Rabins pseudo-primality tests and one Lucas pseudo-primality test. The probability that <n> will pass one Miller-Rabin test is less than 1/4. Using the default value 25 for `primep_number_of_tests`, the probability of <n> beeing composite is much smaller that 10^-15.

There are also some inexact matches for `primep`. Try `?? primep` to see them.

```(%o1)                                true
(%i2) ```

### Related Examples

primep(213);

Calculate

##### primep-sqrt

sqrt(((5+3)^4/8^2)/(1...

sqrt((3^6/(6-3)^4)/(5...

sqrt((36*4*(14+2*11))...

Calculate

##### primep

primep(11111111111111...

p:1111111111111111111;

b:17;

Calculate

n=p+q;

primep(2);

primep(2);

Calculate

##### primep

next_primep(45641);

Calculate

##### primep

F(n):=((2^(2^n))+1);

F(3);

primep(F(3));

Calculate

##### primep

P:2*3*5*7*11*13;

[primep(P-1),primep(P...

Calculate

##### primep

fa(x):=x^3-1;

ff(x):= fa(x)-fa(x-1);

for i:2 thru 10 step ...

Calculate

x:30;

y: x^3-1;

z: (x-1)^3-1;

Calculate

##### primep-sqrt

sqrt(((5+3)^4/8^2)/(1...

sqrt((3^6/(6-3)^4)/(5...

sqrt((36*4*(14+2*11))...

Calculate