The Wayback Machine - https://web.archive.org/web/20250405063607/https://www.geeksforgeeks.org/prime-numbers/
Open In App

Prime Numbers

Last Updated : 19 Nov, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

Prime numbers are those natural numbers divisible by only 1 and the number itself. Numbers with more than two factors are called composite numbers. All primes are odd numbers except for 2.

A total of 25 prime numbers are there between 1 and 100. These 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.

Mathematically prime numbers are defined as:

If p ∈ N, then p is prime if for any integers a and b, if p = a ⋅ b, then either a = 1 or b = 1
OR
p is prime ⟹ p > 1 and if p = a ⋅ b, then either a = 1 or b = 1.

prime-factors


In this article, we will discuss in detail about prime numbers, the list of prime numbers 1 to 100, the differences between prime and composite numbers, their examples, the prime numbers chart, etc.

There are 25 prime numbers between 1 to 100. The image added below shows the prime numbers from 1 to 100.

Prime-Numbers

Read More:

Smallest and Largest Prime Number

The smallest prime number is 2. It is unique because it’s the only even prime number. There is no largest prime number, as prime numbers continue infinitely

Read More: Smallest and Largest Prime Number

Properties of Prime Numbers

Prime numbers have some properties which are listed as follows:

  • A Prime number is always a natural number i.e., a number greater than 1.
  • There are infinitely many prime numbers. This was proved by Euclid around 300 BC.
  • Every positive integer greater than 1 can be written as a product of prime numbers in a unique way, up to the order of the factors. This is known as the Fundamental Theorem of Arithmetic.

Please refer Interesting Facts about Prime Numbers for more interesting facts.

Prime Factorization

Prime factorization involves breaking down a composite number into a product of prime numbers. For example, the prime factorization of 60 is 22 x 3 x 5. This is useful for solving problems involving divisibility, greatest common divisors, and least common multiples.

Read More: Prime Factorization

Prime Factorization of Some Numbers

Prime factorization of some of the common composite number are:

NumbersPrime Factorization

Numbers

Prime Factorization

3622 Ã— 32

40

23 Ã— 5

2423 Ã— 3

50

2 × 52

6022 Ã— 3 × 5

48

24 Ã— 3

182 × 32

30

2 × 3 × 5

7223 Ã— 32

42

2 × 3 × 7

4532 Ã— 5

20

22 Ã— 5

Prime Numbers vs Composite Numbers

There are a few differences between Prime and Composite numbers, which are as follows:

Prime Numbers

Composite Numbers

All Prime Numbers have only two factors such as 1 and the number itself. For example, 5 has only two factors 1 and 5.All Composites Numbers must have any factor other than 1 and the number itself. For example, 6 has 2 and 3 as its factors other than 1 and 6.
All Primes are Odd numbers except 2.Composites can be either odd or even.
Some of the first few primes are 2, 3, 5, 7, 11, 13, 17, etc.Some of the first few composites are 4, 6, 8, 9, 12, 14, 15, etc.
Fact about Prime Number-3

Coprime Numbers

Coprime numbers have just a single common factor, which is 1. This means that a pair of numbers is said to be coprime if their largest common factor is 1.

Note: All primes numbers are coprime to each other.

Read More: Co Prime Numbers

Interesting Facts about Prime Numbers

Some of the interesting facts about Prime Numbers are mentioned below:

  • With the exception of 2, which is an even prime number, all prime numbers are odd.
  • All prime numbers, with the exception of 2 and 5, ends with 1, 3, 7, or 9.
  • A product of two or more prime numbers can be used to express any positive number larger than one in a unique way.
  • Two prime integers can be added to represent any even positive integer.

Read More: Interesting Facts about Prime Numbers

How to Find Prime Numbers?

Let’s learn some simple methods, which can help us easily identify that given number is a Prime or not.

  • All even numbers are NOT Prime, except for 2. This means if a number ends with 0, 2, 4, 6, or 8, it is not prime.
  • Prime Numbere can also be found by Divisibility Rules for Small Primes.
  • Division Method and Factorization Method are also used to find prime numbers.

Read in Detail: How to Find Prime Numbers

Algorithms to Check for Prime

Since there is no formula to directly check whether a given number is prime or not, we typically use compute programs to check the same. There exist many algorithms to do the same. The best possible time we get for prime numbers is O(Log n) for a given number n if we have not done any preconceptions. Please refer Check for Prime Number for all programs and algorithms in detail.

Also Check:

Applications of Prime Numbers in Real Life

There are so many real life examples of prime numbers in real life. These uses and applications are mentioned below:

  • Cryptography
  • RSA Encryption
  • Internet Security
  • Digital Signatures
  • Credit Card Transactions

Read More: Applications of Prime Numbers in Real Life

Some of the important theorems related to prime numbers are:

  • Euclid Division Lemma
  • Wilson Theorem
  • Fermat’s Little Theorem

Euclid Division Lemma

Euclid’s Division Lemma gives the relation between the various components of Division. It explains that for any two positive integers say a and b there exist two unique integers q and r such that a = bq + r where q the quotient of the division, and r is the remainder of the division.

Read in Detail: Euclid’s Division Lemma

Wilson Theorem

Wilson Theorem states that if p is any natural number greater than 1, then p is said to be a prime number if and only if the product of all the positive integers less than p is one less than a multiple of number p.

Read in Detail: Wilson’s Theorem

Fermat’s Little Theorem

According to Fermat’s Little theorem, if p is a prime number and a is a positive integer not divisible by p, then there exists a positive integer k such that ak – 1 is divisible by p.

Read in Detail: Fermat’s Little Theorem

Importance of Prime Numbers

Prime Numbers hold a significant place in the evolution of mathematics, primarily for their crucial role in improving cryptography and security standards in the modern world. Despite years of research, Prime Numbers continue to be an active topic in the field of mathematical research, fascinating scientists and scholars with their elegant properties and wide range of applications.

  • Prime numbers are the basic building blocks of natural numbers. Every integer greater than 1 can be uniquely expressed as a product of primes, known as the Fundamental Theorem of Arithmetic. This uniqueness is crucial for number theory.
  • Prime numbers play a vital role in modern cryptography, particularly in algorithms like RSA. They are used to create keys for secure data transmission, ensuring that sensitive information remains private.
  • Primes are central to many important theorems and conjectures in mathematics, such as the Goldbach Conjecture and the Prime Number Theorem, which describes the distribution of prime numbers among the integers.
  • In computer algorithms, prime numbers are used in hashing functions and data structures, helping to optimize performance and reduce collisions in hash tables.
  • Studying prime numbers contributes to the understanding of randomness and patterns in mathematics. Their distribution can reveal insights into more complex mathematical structures and theories.

Prime Numbers Examples

Example 1: Determine whether 37 is a prime number or not.

Solution: 

As a prime number is a positive integer greater than 1 that has no positive integer divisors other than 1 and itself.
As 37 = 1 × 37, 
Therefore, 37 has no divisors other than 1 and itself, and it is a prime number.
So, 37 is a prime number.

Example 2: Find all the prime numbers between 20 and 40.

Solution: 

The prime numbers between 20 and 40 are 23, 29, and 37.

Example 3: Is 19 a Prime Number?

Solution:

Let us write the given number in the form of 6n Âą 1.
6(3) + 1 = 18 + 1 = 19
Therefore, 19 is a prime number

Example 4: Which is the greatest prime number between 1 to 10?

Solution:

There are 4 prime numbers between 1 and 10 and the greatest prime number between 1 and 10 is 7.

Examples 5: Why is 20 not a prime number?

Solution:

The factors of 20 are 1, 2, 4, 5, 10, and 20. Thus, 20 has more than two factors. Since the number of factors of 20 is more than two numbers, it is NOT a prime number.

Also Read:

Articles Related to Prime Numbers

Real Numbers

Imaginary Numbers

Rational Number

Irrational Numbers

Complex Numbers

Triangular Numbers

Practice Questions on Prime Numbers

1. Find the first 5 prime numbers.

2. Determine whether the following numbers are prime or not: 17, 25, 29, 37, 41.

3. Calculate the product of the first 3 prime numbers.

4. What is the sum of the first 10 prime numbers?

5. Find the prime factorization of the number 56.

6. Is 97 a prime number? Explain why or why not.

7. What is the List all prime numbers between 50 and 100.

8. What is the prime factorization of 84?

9. Find the sum of the prime numbers between 10 and 30.

10. Identify the twin primes between 40 and 60 (twin primes are pairs of primes that differ by 2).

Answers

  1. 2, 3, 5, 7, 11
  2. Prime: 17, 29, 37, 41
    Not Prime: 25
  3. 30 (2 × 3 × 5)
  4. 129
  5. 23 × 7
  6. Yes, 97 is prime.
  7. 53, 59, 61, 67, 71, 73, 79, 83, 89
  8. 22 × 3 × 7
  9. 60 (11 + 13 + 17 + 19)
  10. 41 and 43, 59 and 61 (twin primes)

Prime Numbers for Programmers

Conclusion

Prime numbers are fundamental building blocks in mathematics, with applications from basic arithmetic to advanced theories and applications in cryptography, computer science, and number theory. Understanding prime numbers helps us learn about the simplicity and complexity of numbers, as they are the indivisible elements that shape various mathematical structures. By exploring the properties of prime numbers, we gain deeper insights into the nature of numbers and their crucial role in both theoretical and practical domains of mathematics.

Also Check: Prime Numbers Worksheet

Prime Numbers – FAQs

What are prime numbers?

Prime numbers are positive integers greater than 1 that has no positive integer divisors other than 1 and itself.

What prime numbers are even?

There is only one such prime number which is even i.e. 2. Therefore 2 is called only even prime.

Is 1 a prime number?

1 is neither prime nor composite number.

What are twin prime numbers?

Twin prime are the pair of primes which has difference of 2(when smaller is subtracted from greater). For example 5 and 7 as 7-5=2.
Some more examples of twin primes are 3 and 5 (5-3=2), 11 and 13, 17 and 19, 29 and 31, 41 and 43, etc.

What are the first 10 prime numbers?

First ten primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29.

What are the prime numbers between 70 and 90?

The prime numbers between 70 and 90 are 71, 73, 79, 83, and 89

What are twisted prime numbers?

A pair of number is called Twisted Primes if both numbers are palindrome as well as prime themselves. For example, 17 and 71 are Twisted Prime Pair as both are palindrome (reversing the digits of 17 number become 71 and same for the 71) as well as prime themselves.  

Why is 2 a prime number?

2 is considered a prime number because it meets the fundamental definition of a prime number: it is a positive integer greater than 1 that has no positive integer divisors other than 1 and itself. In the case of 2, it can only be divided by 1 and 2 without leaving a remainder.

What is a prime number for kids?

A prime number is a special kind of whole number greater than 1 that has only two factors: 1 and the number itself. In other words, it cannot be evenly divided by any other numbers except 1 and the number itself. Examples of prime numbers include 2, 3, 5, 7, and 11.

Is 1 composite or prime?

No, 1 is neither composite nor prime. Prime numbers have exactly two distinct positive divisors (1 and the number itself), and composite numbers have more than two divisors. Since 1 only has one distinct positive divisor (itself), it doesn’t fit the definition of a prime or composite number.

What is the fastest way to find a prime number?

The fastest way to find a prime number depends on the context. However, using a method like the Sieve of Eratosthenes is efficient for finding smaller prime numbers. For larger primes, probabilistic algorithms like the Miller-Rabin test or deterministic ones like the AKS primality test are commonly used.

Which is the largest known prime number?

The largest known prime number is a Mersenne prime of the form 282,589,933−12^{82,589,933} – 1282,589,933−1. It was discovered in December 2018 and contains over 24 million digits.

What is the lowest prime number?

The smallest prime number is 2.



Next Article
Practice Tags :

Similar Reads

three90RightbarBannerImg