Tool to test / find / check co-prime numbers (relatively prime). Two (or more) Integers are called coprimes if their GCD (greatest common divisor) is equal to 1.
Coprimes - dCode
Tag(s) : Arithmetics
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Formally, in mathematics, two numbers are coprimes if the GCD (greatest common divisor) of these numbers is equal to 1. This definition can be extended to N numbers (pairwise).
Example: GCD(4,6) = 2, then 4 and 6 are not coprimes.
Example: GCD (4,5,6) = 1 then 4, 5 and 6 are coprimes, but not pairwise coprime as 4 and 6 are not relatively primes.
Example: GCD (7,12) = 1 then 7 and 12 are coprimes.
For two numbers a and b, Calculate the GCD(a,b) of the 2 numbers, if it is equal to 1 then the 2 numbers a and b are relatively primes.
dCode's calculator/checker tests numbers depending on the prime factor decomposition of the first number (and therefore its divisors) to find coprime numbers. Then check that GCD equals 1 to confirm the number.
See also the Euler Totient or the primality tests.
Some calculators have the coprime() function or use the gcd() function and check that the value is 1.
According to the definition, yes, 1 and 1 are coprimes as GCD(1,1)=1. Moreover 1 and any positive integer are relatively primes.
dCode retains ownership of the "Coprimes" source code. Any algorithm for the "Coprimes" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Coprimes" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Coprimes" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Coprimes" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Coprimes on dCode.fr [online website], retrieved on 2025-04-24,