Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Natural Numbers
  • Whole Numbers
  • Real Numbers
  • Integers
  • Rational Numbers
  • Irrational Numbers
  • Complex Numbers
  • Prime Numbers
  • Odd Numbers
  • Even Numbers
  • Number System
Open In App
Next Article:
Coprime Numbers
Next article icon

Coprime Numbers

Last Updated : 08 Oct, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Coprime Numbers are a pair of numbers with just one factor in common, which is 1. To put it another way, a pair of relatively prime numbers is said to be co-prime if their highest common factor (HCF) is 1.

  • 5 and 7 are Coprime as the common factor is only 1.
  • 22 and 11 are NOT Coprime as there is a common factor 11 (apart from 1)
  • 21 and 22 are Coprime as the only common factor is 1.

Table of Content

  • Properties of Coprime Number
  • Co Prime Numbers from 1 to 100
  • How To Find Co Prime Numbers
  • Difference between Prime and Co Prime Numbers
  • Difference between Co Prime and Twin Prime Numbers
  • Examples & Practice Questions on Co Prime Numbers

Properties of Coprime Number

Co-prime numbers' key properties are as follows :

  • Two prime numbers are always coprime. They only share 1 as their common factor.
  • Two Composite Numbers can also be Coprime if their GCD is 1. For example 9 and 4.
  • A pair of coprime numbers' s GCD always 1.
  • The result of multiplication of two co-primes is always their LCM.
  • Every number and 1 makes a pair of co-prime numbers.
  • Due to the fact that two even numbers always have 2 in common, they cannot both be co-prime numbers.
  • The sum of two Coprime Numbers is also Coprime with their product.
  • Two Consecutive Numbers are always Coprime. For example 3 and 4, 4 and 5, etc
coprimes

Co Prime Numbers from 1 to 100

There are many pairs of co-primes from 1 to 100. We can write each number along with 1 as a co-prime pair.

List of Co Prime Numbers

Co prime pairs with numbers, starting from 1 are listed in the table below :

List of Co Prime Pairs

Co prime withCo-prime numbers pairs
1(1, 2), (1, 3), (1, 4), (1, 5)  (1, 6),….., (1, 20),….
2(2, 3), (2, 5), (2, 7), (2, 9), …, (2, 15),…..
3(3, 4), (3, 5), (3, 7), (3, 10), (3, 11),…., (3, 20),…
4(4, 5), (4, 7), (4, 9), (4, 11), (4, 13), (4, 15),….
5(5, 6), (5, 7), (5, 8), (5, 9), (5, 11), (5, 12),…

How To Find Co Prime Numbers

A pair of integers is co-prime if there is no other positive integer (other than 1) that can divide them both.
For instance, 21 and 22

21 and 22:

1, 3, 7, and 21 are the factors of 21.
1, 2, 11, and 22 are the factors of 22.

Here, 21 and 22 only share a single factor, which is 1. Since they are co-prime, their HCF equals 1.

For instance, 15 and 20

15 and 20:

1, 3, 5, and 15 are the factors of 21.
1, 4, 5, and 20 are the factors of 27.

Here, the numbers 1 and 5 are two factors that 21 and 27 both share. They are not co-prime and HCF is 5.

Difference between Prime and Co Prime Numbers

While prime numbers can be part of a co-prime pair, co-prime numbers themselves do not need to be prime.

Let's compare prime numbers and co-prime numbers:

Prime vs. Co Prime Numbers

AspectPrime NumbersCo-Prime Numbers
DefinitionA prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.Co-prime numbers are two or more numbers that have no common positive divisor other than 1.
DivisibilityA prime number can be divided evenly only by 1 and itself.Co-prime numbers can be divided evenly only by 1 when considered together.
Examples2, 3, 5, 7, 11, 13, 17, etc.(15, 28), (9, 16), (8, 21), etc.
Number of NumbersConcerns a single number.Involves a pair or set of numbers.
Nature of NumbersAlways integers greater than 1.Can be any integers, including 1 and negative numbers.
Common FactorThe only common factor is the number itself and 1.The only common factor is 1.
Special PropertiesAll prime numbers are odd, except for 2, which is the only even prime number.Co-prime numbers do not need to be prime; for example, 8 (which is not prime) and 9 are co-prime.

Difference between Co Prime and Twin Prime Numbers

Co-prime numbers have their HCF as 1. Twin prime numbers, on the other hand, are prime numbers whose difference is always 2. For instance, 3 and 5 are twin prime numbers.

Let's make a comparison between co-prime and twin prime numbers are :

Co Primes vs. Twin Prime Numbers

FeatureCo Prime NumbersTwin Prime Numbers
Nature of NumbersCan be composite or primeAlways prime
Difference Between NumbersCan be any numberAlways 2
Relationship to Each OtherMay or may not be twin primesAlways co-prime
Special PairsEvery number forms a co-prime pair with 1Only the pair (3, 1) is considered as twin primes.

Also Check,

  • Whole Numbers
  • Numbers
  • Natural Numbers

Solved Examples on Co Prime Numbers

Here we have solved some examples on co-prime numbers for your help.

Example 1: Check if 259 and 256 are co-prime numbers.

Solution:

Given numbers are 259 and 256.

1,2,4,8,16,32,64,128 and 256 are the factors  of 256.

1,7,37 and 259 are the factors of 259.

They only have 1 as their common factor hence they are co-prime numbers.

Example 2: Check whether 28 and 21 are co-prime numbers.

Solution:

Given numbers are 28 and 21.

1,3,7 and 21 are the factors of 21.

1,2,4,7 and 28 are the factors of 28.

21 and 28 have 1,7 as their common factors. Since their highest common factor is 7.Hence, they are not co-prime numbers.

Co Prime Numbers Practice Exercise

Here are some practice questions on co prime numbers for you to solve :

1. If the product of two co prime numbers is 117, then find their LCM.

2. Are 17 and 68 co prime numbers? Justify.

3. Are 30 and 415 co prime numbers? State your reasons.

4. Are 216 and 215 co prime numbers?

5. Are 18 and 35 Coprime Pairs?


Next Article
Coprime Numbers

Y

yashika26
Improve
Article Tags :
  • Mathematics
  • School Learning
  • Class 6
  • Numbers
  • Maths-Class-6
Practice Tags :
  • Numbers

Similar Reads

    Composite Numbers
    Composite numbers are those positive integers that can be be formed by multiplying two smaller positive integers. Composite numbers are just the opposite of prime numbers, Unlike prime numbers, which are divisible only by 1 and themselves, composite numbers can be divided by additional positive inte
    10 min read
    Curzon Numbers
    Given an integer N, check whether the given number is a Curzon Number or not. A number N is said to be a Curzon Number if 2N + 1 is divisible by 2*N + 1. Example: Input: N = 5 Output: Yes Explanation: 2^5 + 1 = 33 and 2*5 + 1 = 11 Since 11 divides 33, so 5 is a curzon number. Input: N = 10 Output: N
    4 min read
    List of Composite Numbers
    Composite numbers are positive integers that have more than two distinct positive divisors. In other words, a composite number can be divided evenly by numbers other than 1 and itself. This means that composite numbers can be formed by multiplying two or more integers together, making them non-prime
    1 min read
    Prime and Composite Numbers
    Prime and Composite Numbers are commonly used classifications of Natural Numbers based on divisibility. A prime number is divisible by only 1 and itself and a composite number is divisible by one or two more other Every natural number, except 0 or 1, is either prime or composite. Table of ContentPri
    5 min read
    Compositorial of a number
    Given a natural number N, the task is to find the Nth compositorial number. Compositorial of a number refers to the product of all the positive composite integers up to N. The compositorial of a number N is denoted by \frac{N!}{N#} where N! is the factorial of the number and N# is the Primorial of t
    7 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences