Skip to content

Instantly share code, notes, and snippets.

@lyxal
Created August 12, 2021 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lyxal/072e85d4313a1762368363bc3141a73d to your computer and use it in GitHub Desktop.
Save lyxal/072e85d4313a1762368363bc3141a73d to your computer and use it in GitHub Desktop.
What are prime numbers?
Prime numbers are the building blocks of the number system. Every whole number can be written as a product of prime numbers. The smallest prime number is 2. The largest prime number is a really huge number called Graham’s number. Humans can’t write down Graham’s number.
A number is called prime if it is only divisible by 1 and itself. The first few prime numbers are 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, and 101.
But what about prime numbers less than 100?
If you look at the first prime numbers, you will find that they are all less than 100. The reason is that no number can be divided by both 2 and 3.
If we take the next prime number after 25, which is 27, we find that 27 is divisible by both 2 and 3.
So, which numbers are prime?
The numbers that are not prime are called composite numbers. Composite numbers are all of the numbers that can be written as products of whole numbers.
Which numbers are composite?
If we write down all of the whole numbers, we will find that there are composite numbers. These composite numbers are all of the values that are not prime.
We can see from this that there are no prime numbers between 2 and 3. All of the prime numbers are less than 3.
But what about between 3 and 4?
The only prime numbers between 3 and 4 are 3 and 5. All of the other numbers are composite.
If we look at all of the prime numbers less than 100, we can see that they are all divisible by both 2 and 3. So, this means that any numbers that are divisible by both 2 and 3 are not prime.
We can also see that any number divisible by both 2 and 5 is also not prime.
So, what about the numbers that are divisible by both 2 and 5?
These numbers are not prime. They are all divisible by both 2 and 5, which means that they are divisible by 10.
Let’s look at the first composite number.
The first composite number is 6. Because 6 is divisible by both 2 and 3, we know that it is not prime.
We can also see that 6 is divisible by both 2 and 5, which means that it is divisible by 10.
If we look at the first prime number after 6, which is 7, we can see that it is not divisible by 2, 3, 5, or 10. This means that 7 is prime.
If we look at the next prime number after 7, which is 11, we can see that it too is not divisible by 2, 3, 5, or 10. This means that 11 is also prime.
We can see from this that all of the prime numbers less than 10 are prime.
But what about prime numbers less than 20?
If we look at the first prime numbers less than 20, we can see that any number that is divisible by both 2 and 3 is not prime.
We can also see that any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment