Prime numbers are defined as numbers greater than 1 that have no divisors other than 1 and themselves. These unique numbers play a crucial role in various fields, including cryptography, number theory, and computer science.
There are several methods to identify prime numbers, and formulas like the well-known 6n ± 1 and n² + n + 41 help generate primes under specific conditions. This article will explore the different prime number formulas, methods for testing primality, and solved and practice problems of primes.
Prime number formulas are mathematical expressions that help identify or generate prime numbers. Here are a few commonly known formulas:
- 6n ± 1 Formula
- n2 + n + 41 Formula
6n ± 1 formula is a way to identify potential prime numbers. It suggests that, for any integer n ≥ 1, prime numbers (except 2 and 3) can be expressed as either 6n+1 or 6n−1. This formula helps narrow down the possible prime candidates, as all primes greater than 3 follow this form.
Why 6n ± 1?
Most numbers divisible by 2 or 3 do not fit into the 6n ± 1 form. For example, numbers like 6n (divisible by 6) or 6n ± 2 (even numbers) are not prime, except for 2.
For Example:
- For n = 1
6 × 1 + 1 = 7 and 6 × 1 − 1 = 5. Both 5 and 7 are prime numbers.
- For n = 2
6 × 2 + 1 = 13 and 6 × 2 − 1 = 11, both of which are also prime.
- For n = 3
6 × 3 + 1 = 19 and 6 × 3 − 1 = 17, both 17 and 19 are prime numbers.
- For n = 4
6 × 4 + 1 = 25 and 6 × 4 − 1 = 23, 23 is prime, but 25 is not.
- For n = 5
6 × 5 + 1 = 31 and 6 × 5 − 1 = 29, both 29 and 31 are prime numbers.
- For n = 6
6 × 6 + 1 = 37 and 6 × 6 − 1 = 35, 37 is prime, but 35 is not.
- For n = 7
6 × 7 + 1 = 43 and 6 × 7 − 1 = 41, both 41 and 43 are prime numbers.
n2 + n + 41 formula is a famous quadratic formula that generates prime numbers for values of n between 0 and 39. It was discovered by the mathematician Euler, and it demonstrates an interesting property where consecutive values of n produce prime numbers. However, beyond n = 39, the formula starts to generate composite numbers.
For n = 0 to n = 39, the output of this formula results in a prime number. For example:
- When n = 0
02 + 0 + 41 = 41 (Prime No.)
- When n = 1
12 + 1 + 41 = 43 (Prime No.)
- When n = 2
22 + 2 + 41 = 47 (Prime No.)
- When n = 3
32 + 3 + 41 = 53 (Prime No.)
- When n = 4
42 + 4 + 41 = 61 (Prime No.)
- When n = 5
52 + 5 + 41 = 71 (Prime No.)
- When n = 6
62 + 6 + 41 = 83 (Prime No.)
- When n = 7
72 + 7 + 41 = 97 (Prime No.)
However, for values of n ≥ 40, this formula begins to produce non-prime numbers. For instance:
- When n = 40, 402 + 40 + 41 = 1681, which is not prime (it’s 412)
How to Check if a Number is Prime?
To check if a number is prime, several methods can be used depending on the size of the number:
Trial Division Method
This is the simplest way to check if a number is prime. It involves dividing the number by all integers starting from 2 up to the square root of the number.
- If the number is divisible by any of these integers, it is not a prime number.
- If none of these integers divide the number, then it is a prime number.
- Example: To check if 29 is prime, check divisibility by all integers from 2 to √29 (approximately 5.39). Since 29 is not divisible by 2, 3, or 5, it is a prime number.
Note: We can also use the discussed formulas for the same.
Example 1: Check if 29 is a prime number.
Solution:
Step 1: Use the formula 6n + 1 or 6n − 1 to find if 29 fits.
Step 2: For n = 5, 6 × 5 − 1 = 29.
Step 3: Since 29 fits the 6n − 1 form, it could be prime.
Step 4: Now, check divisibility by smaller primes (2, 3, 5). Since 29 is not divisible by any of these, it is confirmed to be a prime number.
Example 2: Find the prime numbers generated by the formula for n = 0 to n = 3.
Solution:
For n = 0, 02 + 0 + 41 = 41, which is prime.
For n = 1, 12 + 1 + 41 = 43, which is prime.
For n = 2, 22 + 2 + 41 = 47, which is prime.
For n = 3, 32 + 3 + 41 = 53, which is prime
Example 3: Check if 77 is Prime or not Using Trial Division.
Solution:
Step 1: Find the square root of 77.
The approximate square root of 77 is ≈ 8.77. This means we only need to check divisibility by the prime numbers less than or equal to 8 (i.e., 2, 3, 5, and 7).
Step 2: Check divisibility by 2.
77 is odd, so it is not divisible by 2.
Step 3: Check divisibility by 3.
The sum of the digits of 77 is 7+7=147 + 7 = 147+7=14, which is not divisible by 3. Therefore, 77 is not divisible by 3.
Step 4: Check divisibility by 5.
Since 77 does not end in 0 or 5, it is not divisible by 5.
Step 5: Check divisibility by 7.
77 ÷ 7 = 11. Since 77 is divisible by 7, it has a divisor other than 1 and itself.
So 77 is not a prime number, as it has divisors other than 1 and itself
Problem 1: Using the 6n±1 formula, determine whether the following numbers are prime: 17, 23, 31, 41.
Problem 2: Apply the quadratic formula n2+n+41 for values of n = 4, 5, 6, 7 and check if the resulting numbers are prime.
Problem 3: Find all prime numbers between 50 and 100 using the 6n ± 1 formula. Verify your results.
Problem 4: Test whether 83 is a prime number using the trial division method.
Read More,