So, a lot of people have been asking on the internet, What is a prime number?. According to the reports, a prime number refers to a natural number greater than 1. Moreover, it should also be divisible by only 1 and itself. So, we can also say that a prime number is a positive integer that’s greater than 1 and that has exactly two factors, 1 and the same number.
The first few prime numbers are 2,3,5,7,11,13,17,19,23 and so on. Please note that 1 is not either prime or composite according to many. On the other hand, the remaining numbers, except 1, are prime numbers. For instance, 2,3,5,7, etc are prime numbers.
So, let’s take a look at more about prime numbers and details regarding them. In this article, we shall take a look at some of the fascinating facts about prime numbers, and interesting facts about them.
What Are The Prime Numbers?
So, if you are someone who wants to know what is a prime number, then you are at the right place. As we mentioned previously, a prime number refers to a natural number that’s greater than 1 and that’s divisible by only 1 and the number itself. For example, 2,3,5,7 are the prime numbers.
Interesting Facts About Prime Numbers
Now that we know what is prime number, it’s time to take a look at some of the facts about prime numbers.
- Except for the smallest and the only even prime number which is 2, all prime numbers are odd numbers.
- So, it’s worth noting that you can represent every prime number in the form of 6n + 1or 6n – 1 except the prime numbers 2 and 3 where n is any natural number.
- Moreover, it’s worth noting that 2 and 3 are the only two consecutive natural numbers that we know as prime.
- You can express every even integer that’s greater than 2 as the sum of two primes.
- So, according to Wilson’s theorem, a natural number p > 1 is a prime number if and only if
(p-1)! = -1 mod p, or (p-1)! = (p-1) mod p
- As per Fermat’s little theorem, if n is a prime number, then for every a, 1 is smaller or similar to A, which is further smaller than n.
A to the power of n-1 = 1(mod n) Or, a to the power of n-1 % n = 1
- So, according to the prime number theorem, the probability that a randomly chosen number n is prime is inversely proportional to its digits, or to the log of n.
- In addition, you can express an odd integer greater than 5 as a sum of an odd prime, and even a sense semiprime. A Semiprime number, as we know, is a product of two prime numbers. In fact, we know this as Lemoine’s conjecture.
What Are The Properties Of Prime Numbers
- You can divide every number that’s greater than 1 by at least one prime number.
- Moreover, you can express every even positive integer greater than 2 as the sum of two primes.
- So, except 2, all other prime numbers are odd, as mentioned earlier. In fact, we can say that 2 is the only even prime number.
- In addition, two prime numbers are always coprime to each other according to the reports.
- You can factor each composite number into prime factors. In fact, individually, all these numbers are unique.
Prime Numbers And Co-Prime Numbers
So, it’s important to distinguish between prime numbers and co-prime numbers for many reasons. Let’s take a look at some of the differences between these two.
- So, coprime numbers are always known as a pair, whereas, a prime number is a single number.
- In addition, co-prime numbers are numbers that do not have any common factors except one. On the other hand, prime numbers don’t have such conditions at all.
- For several reasons, a co-prime number can either be a prime or a composite. However, its greatest common factor must be: Unlike compost numbers, prime numbers have only two factors, 1 and the number we know itself.
- Co-prime numbers: 13 and 15 are co-primes while the factors of these are 13 and 1 for 13 and for 15, 1,3, and 5. Since 1 is the common factor, then 1 is their coprime number.
- Prime numbers, on the other hand, are 2,3,5,7, and 11.
Checking Whether Or Not A Number Is Prime
So, there are a few ways to check whether a number is a prime or not. According to the naive approach, it’s very easy to do this. Let’s see how you can do this.
- Iterate from 2 to (n-1) and see if any number in this range divides n or not. If it does divide n, then it’s not a prime number.
Time complexity is O (N), while auxiliary space is O(1). You can also use a naive approach (recursive) to see if a number between 2 to n -1 divides n. If there’s a number that divides, we return false.
Prime numbers are quite interesting, and there are many interesting facts available about these numbers. In this article, we have found the definition of prime numbers, and some interesting facts. Additionally, the article also focused on the differences between a prime number and a co-prime number. We have also mentioned how you can check whether or not a number is a prime number.