Skip to content

devarsh-solanki/PrimeNumberGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

PrimeNumberGenerator

-> What are prime numbers?

A prime number is a natural number greater than 1, which is only divisible by 1 and itself. First few prime numbers are: 2 3 5 7 11 13 17 19 23...
Prime number image...

In other words, the prime number is a positive integer greater than 1 that has exactly two factors, 1 and the number itself.
There are many prime numbers, such as 2, 3, 5, 7, 11, 13, etc.
Keep in mind that 1 cannot be either prime or composite.
The remaining numbers, except for 1, are classified as prime and composite numbers.

-> Different Prime generator strategy :

NativePrime1
NativePrime2
SieveBooleanPrimeMethod
SieveOfEratosthenes

-> Properties of prime numbers:

Every number greater than 1 can be divided by at least one prime number.
Every even positive integer greater than 2 can be expressed as the sum of two primes.
Except 2, all other prime numbers are odd. In other words, we can say that 2 is the only even prime number.
Two prime numbers are always coprime to each other.
Each composite number can be factored into prime factors and individually all of these are unique in nature.