Back to Cosmos

Coprime_number

code/mathematical_algorithms/src/coprime_numbers/README.md

latest1.2 KB
Original Source

Coprime_number

Two numbers are said to be co-prime numbers if they do not have a common factor other than 1 or two numbers whose Highest Common Factor (HCF) or Greatest Common Divisor (GCD) is 1 are known as co-prime numbers.

Examples of co-prime numbers are:

3 and 7 are co-prime, 7 and 10 are co-prime etc.

Note : Co-prime numbers do not require to be prime numbers. <b>Properties of Co-Prime Numbers</b> Some of the properties of co-prime numbers are as follows.

<ul> <li>1 is co-prime with every number.</li> <li>Every prime number is co-prime to each other: As every prime number have only two factors 1 and the number itself, the only common factor of two prime numbers will be 1. For example, 2 and 3 are two prime numbers. Factors of 2 are 1, 2 and factors of 3 are 1, 3. The only common factor is 1 and hence is co-prime.</li> <li>Any two successive numbers/ integers are always co-prime: Take any consecutive number such as 2, 3 or 3, 4 or 5, 6 and so on; they have 1 as their HCF.</li> <li>The sum of any two co-prime numbers are always co-prime with their product: 2 and 3 are co-prime and have 5 as their sum (2+3) and 6 as the product (2×3). Hence, 5 and 6 are co-prime to each other.</li> </ul>