Understanding Prime Numbers: Definition, Properties, and Python Examples

Rumman Ansari   Software Engineer   2024-07-26 07:04:08   450  Share
Subject Syllabus DetailsSubject Details 6 Program
☰ TContent
☰Fullscreen

Table of Content:

Prime numbers are the numbers that have only two factors, that are, 1 and the number itself.

Consider an example of number 5, which has only two factors 1 and 5. This means it is a prime number.

5 is Prime Number

Let us take another example of the number 6, which has more than two factors, i.e., 1, 2, 3, and 6. This means 6 is not a prime number.

6 is not Prime Number

Now, if we take the example of the number 1, we know that it has only one factor. So, it cannot be a prime number as a prime number should have exactly two factors. This means 1 is neither a prime nor a composite number, it is a unique number.

Prime numbers are the natural numbers (positive integer) greater than 1 with exactly two factors, i.e. 1 and the number itself.

Any whole number greater than 1 that is divisible only by 1 and itself, is defined as a prime number.

Prime Factor

Factors of a number that are prime numbers are called as Prime factors of that number. For example: 2 and 5 are the prime factors of 10.

2 and 3 are the prime factors of 18.

Prime Factors of 18

List of Prime Numbers

There are 25 prime numbers from 1 to 100. The complete list of prime numbers from 1 to 100 is given below:

List of Numbers Prime Numbers
Between 1 and 10 2, 3, 5, 7
Between 11 and 20 11, 13, 17, 19
Between 21 and 30 23, 29
Between 31 and 40 31, 37
Between 41 and 50 41, 43, 47
Between 51 and 100 53, 59, 61, 67, 71, 73, 79, 83, 89, 97

Properties of Prime Numbers

Some of the important properties of prime numbers are given below:

  • A prime number is a whole number greater than 1.
  • It has exactly two factors, that is, 1 and the number itself.
  • There is only one even prime number, that is, 2.
  • Any two prime numbers are always co-prime to each other.
  • Every number can be expressed as the product of prime numbers.