Online Math tools

Online isPrime function, primality test

Check if a number is prime or not.
Isprime function return a boolean (true or false) depend on the number is prime or not.
* Put a number in every line.

What is a prime number?

A natural number $n$ is a prime number if and only if had exactely $2$ divisors.
The first prime numbers less than $100$:

How to determine if a number is prime?

A composite number $n$ has a divisor $d$ verify : $2 \leq d \leq \sqrt{n}$.
Then to check a number $n$ if it's prime or not we should try the divisibility of $n$ by prime numbers less than $\sqrt{n}$.
This method is useful only with small numbers, if we have large numbers we should use other algorithms like Miller–Rabin primality test.
Share page