Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

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.

makelist(sum((f(n,k,n-k)*(is(equal(primep(k)*primep(n-k),true^2))-unknown)/(true-unknown)),k,0,n),n,2,10);

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

x: 296919292294585669...

primep(x + 0);

primep(x + 4);

Calculate

primep

P:2*3*5;

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

Calculate

primep

primep(68768768767867...

Calculate

primep

primep (7);

Calculate

primep

primep(12121212121);

primep(32323232323);

primep(78787878787878...

Calculate

primep

y:7791257157566819192...

x:y-1;

primep(x);

Calculate

primep

x: 296921676027441647...

primep(x + 0);

primep(x + 4);

Calculate

primep

primep(2016);

Calculate

primep

primep(11111111111111...

Calculate

primep

next_primep(45641);

Calculate