Need to know if a number is prime? The easiest way to find out is to use our **prime number calculator** thanks to which, you only have to enter the number, press the calculate button and you will automatically know if a number is prime or not.

Article sections

## What is a prime number?

A prime number is a number **natural number** greater than one and that can be **to decompose into two specific factors**This was discovered more than 2,000 years ago by Euclid, a famous Greek mathematician.

If you want to learn how to decompose a number into factorsThe link that we have just left you will show you the process to follow or factor a number online, so you can get out of doubts and **to see if it is a prime number or not**.

## How to know if a number is prime?

To calculate if a number is prime or not what we have to do is to divide it in an orderly way by all the prime numbers smaller than it.

Yes **we do not obtain exact divisions and we manage to get a quotient less than or equal to the divisor**then we are dealing with a prime number.

## Erastótenes sieve for finding prime numbers

There is another method based on the **Sieve of Eratosthenes** to find all the prime numbers less than a certain digit. The process to find all prime numbers is as follows.

The first thing we have to do is **write all the numbers from 2 up to the quantity you want**. For example, let's find all the primes from 2 to 50.

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |

11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |

31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |

41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |

Now we eliminate all those numbers that are multiples of 2:

2 | 3 | 5 | 7 | 9 | ||||

11 | 13 | 15 | 17 | 19 | ||||

21 | 23 | 25 | 27 | 29 | ||||

31 | 33 | 35 | 37 | 39 | ||||

41 | 43 | 45 | 47 | 49 |

We have to repeat the previous step with the following numbers after 2 that have not been eliminated. So, now we eliminate all the multiples of 3:

2 | 3 | 5 | 7 | |||||

11 | 13 | 17 | 19 | |||||

23 | 25 | 29 | ||||||

31 | 35 | 37 | ||||||

41 | 43 | 47 | 49 |

The next number from which we have to remove all its multiples is 5. To simplify the process, we will also remove the multiples of 7.

2 | 3 | 5 | 7 | |||||

11 | 13 | 17 | 19 | |||||

23 | 29 | |||||||

31 | 37 | |||||||

41 | 43 | 47 |

The process of searching for prime numbers with the Erastótenes Sieve** ends when only prime numbers are listed.**.

## Is 1 a prime number?

Although many of us have been taught that **number 1** es primo, lo cierto es que la comunidad matemática no lo considera así actualmente. Esto se debe a que el número 1 no cumple esta premisa de que "*todo número natural tiene una representación única como producto de factores primos, salvo el orden".*

The number 1 has only one divisor: itself. Because of this, right now the number one** is considered neither prime nor composite** but a unit by which all natural numbers can be divided.

## Smallest prime number

Taking into account the reasoning of the previous point, **the smallest prime number that exists is 2**.

## Largest prime number

By contrast, the largest prime number known to date has a total of 22,338,618 digits and it is the **2 ^{74.207.281} -1. **It was discovered on January 7, 2016 and has set a new Guinness record.

This number has been discovered by Curtis Cooper, a mathematician at the University of Central Missouri located in Warrensburg (USA).

Will a prime number larger than this one appear? Yes, it's only a matter of time. Computers and special software are being used all day long to find larger prime numbers. What's more, the group dedicated to this type of discovery has assured that it will not rest until it finds a prime number with 100 million digits.

## Prime numbers from 1 to 100

Below you will find a table that shows the **prime numbers from 1 to 100**You can tell them apart because they are highlighted in red. The rest are not prime numbers:

1 | 2 | 3 | 4 | 5 | 6 |

7 | 8 | 9 | 10 | 11 | 12 |

13 | 14 | 15 | 16 | 17 | 18 |

19 | 20 | 21 | 22 | 23 | 24 |

25 | 26 | 27 | 28 | 29 | 30 |

31 | 32 | 33 | 34 | 35 | 36 |

37 | 38 | 39 | 40 | 41 | 42 |

43 | 44 | 45 | 46 | 47 | 48 |

49 | 50 | 51 | 52 | 53 | 54 |

55 | 56 | 57 | 58 | 59 | 60 |

61 | 62 | 63 | 64 | 65 | 66 |

67 | 68 | 69 | 70 | 71 | 72 |

73 | 74 | 75 | 76 | 77 | 78 |

79 | 80 | 81 | 82 | 83 | 84 |

85 | 86 | 87 | 88 | 89 | 90 |

91 | 92 | 93 | 94 | 95 | 96 |

97 | 98 | 99 | 100 |

The calculator has errors. I entered values ending in 5 and it said they were prime. I did not test further.

Hello Harry,

Thank you very much for your feedback. We have checked with some values ending in 5 and indeed it failed. Thanks for the warning.

We have already solved it and in passing we have taken the opportunity to indicate the number by which it is divisible in case it is not a prime number.

Greetings!

I am just starting to program with PYTHON.

This is the code... Very elementary but it works!

num=int(input("Enter a number :"))

if num==2:

print(num,"...ES is PRIMO")

denomin=2

while denom>=2 and denom<num : # sweeps from 2 to <num

mod_cociente=num%denom # saca el módulus

if mod_quotient ==0 :

print(mod_quotient)

print(num,"...is NOT prime :It is divisible by :", denom)

break

else:

print(mod_quotient)

print(num,"...ES is PRIMO")

denomin=denom+1

# Print multiple answers.VALID LAST!!!

Thank you very much for your contribution Daniel!