Prime: Any positive integer with exactly two factors. 0 and 1 are neither prime or composite.
Composite: Any positive integer with more than two factors.
How to judge if a integer number n is a prime number?
- Number n should be odd. Number n can not be divided by 3. Otherwise it is not prime.
OR: Is this number in 6n+1 or 6n+5 format? If No, n is not a prime. If Yes, n MAY BE a prime. - Calculate square root of this number and floor it to integer m.
- Try to divide all integer from 7 to m, if n can be divided by one of these integers, n is Not a prime number. If n can Not be divided by all of these integers, n is a prime number.
Is there is a formula or better way to judge if a number is a prime number? No
Prime numbers under 100
2 | 3 | 5 | 7 | 11 | 13 | 17 |
19 | 23 | 29 | 31 | 37 | 41 | 43 |
47 | 53 | 59 | 61 | 67 | 71 | 73 |
79 | 83 | 89 | 97 |
Why do prime numbers (except 2 and 3) always satisfy the 6n+1 and 6n-1 (or 6n+5) conditions? Is there mathematical logic behind it?
For any value non-negative integer value of n, make a list of positive values for each of the following values:
- 6n – 1:
- 6n + 0:
- 6n + 1:
- 6n + 2:
- 6n + 3:
- 6n + 4:
- 6n + 5:
Please make your list, and circle the prime numbers:
6n – 1: → 5, 11, 17, 23, 29, 35, 41, 47 …
6n + 0: → 6, 12, 18, 24, 30, 36, 42, 48 …
6n + 1: → 1, 7, 13, 19, 25, 31, 37, 43 …
6n + 2: → 2, 8, 14, 20, 26, 32, 38, 44 …
6n + 3: → 3, 9, 15, 21, 27, 33, 39, 45 …
6n + 4: → 4, 10, 16, 22, 28, 34, 40, 46 …
6n + 5: → 5, 11, 17, 23, 29, 35, 41, 47 …
What can you observe?
The 6n-1 list is identical to the 6n+5 list, we can use either 6n-1 list or 6n+5 list.
Can you look at these lists of numbers and explain why:
- All prime numbers greater than 3 are always of the form
- 6n–1 or 6n+1 ?
Can you also logically explain why the following statements are false?
- All numbers of the form 6n+1 are prime? (false!)
- All numbers of the form 6n–1 are prime? (false!)
Exercise: to judge if following numbers are prime numbers
143
167
169
177
187