Prime Numbers Formula
When any number is divisible only by one and itself, i.e. the number has only two factors, then it is called a prime number. A prime number cannot be factorized because it does not have factors other than 1 and the number itself. The numbers which have more than two factors are called composite numbers. The prime numbers formula helps in representing the general form of a prime number.
Let us learn about the prime numbers formula with a few solved examples in the end.
What Is the Prime Numbers Formula?
The basic formulas to represent a prime number can be given as follows:
 A prime number can be represented in the form:
6n + 1
or
6n  1
not including the numbers that are multiples of prime numbers.
where,
n = natural number
 Prime numbers greater than 40 can be represented as:
n^{2} + n + 41
where n = 0, 1, 2, ….., 39
Method to check if a number is prime or not:
To find if any number is prime or not, find all the possible factors of a number. If the number has only two factors, 1 and the number itself, only then it will be a prime number.
Solved Examples Using Prime Numbers Formulas

Example 1:
Find if 57 is a prime number.
Solution:
To find: If 57 is a prime number
By division method, we find that 1, 3,19, and 57, divide 57 completely without any remainder.
57 has 4 factors.
Therefore, 57 is not a prime number since it has more than two factors.
Also, 57 could not be represented in the form of 6n+1 where 'n' = 1,2,3...
Answer: 57 is not a prime number

Example 2:
Check if 79 is a prime number.
Solution:
To find: If 79 is a prime number
By division method, we find that 1, and 79 divide 79 completely without any remainder.
No other number divides 79 completely.
Thus, 57 has only 2 factors.
Also 79 could be represented in the form of 6n+1 where 'n' = 13 as
6n+1 = 6 13 + 1 = 78 + 1 = 79
Therefore, 79 is a prime number.
Answer: 79 is not a prime number.