- CoprimeQ is typically used to test whether two numbers are relatively prime.
- Integers are relatively prime if their greatest common divisor is 1.
- CoprimeQ[n1,n2] returns False unless n1,n2 are manifestly relatively prime.
- With the setting GaussianIntegers->True, CoprimeQ tests whether Gaussian integers are relatively prime.
- CoprimeQ works over Gaussian integers.
Examplesopen allclose all
Basic Examples (2)
Basic Applications (3)
Number Theory (5)
Use CoprimeQ to compute Euler's totient function:
Use CoprimeQ to check for trivial GCDs:
Properties & Relations (9)
Coprime numbers have a greatest common divisor GCD equal to :
The least common multiple LCM of two coprime numbers is equal to their product:
EulerPhi gives the count of the positive integers up to n that are relatively prime to n:
Wolfram Research (2007), CoprimeQ, Wolfram Language function, https://reference.wolfram.com/language/ref/CoprimeQ.html.
Wolfram Language. 2007. "CoprimeQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CoprimeQ.html.
Wolfram Language. (2007). CoprimeQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CoprimeQ.html