CoprimeQ
Details
- 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.
Examples
open allclose allBasic Examples (2)
Scope (4)
Applications (8)
Basic Applications (3)
Number Theory (5)
Use CoprimeQ to compute Euler's totient function:
Use CoprimeQ to check for trivial GCDs:
Find the fraction of pairs of the first numbers that are relatively prime:
Compute the modular inverse of coprime numbers:
Use ExtendedGCD:
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:
The number of divisors of a number preserves multiplication for coprime numbers:
Coprime numbers a and b satisfy for some integers x and y:
The numbers and are the only integers coprime to every integer:
Prime numbers are relatively prime to each other:
EulerPhi gives the count of the positive integers up to n that are relatively prime to n:
Text
Wolfram Research (2007), CoprimeQ, Wolfram Language function, https://reference.wolfram.com/language/ref/CoprimeQ.html.
CMS
Wolfram Language. 2007. "CoprimeQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CoprimeQ.html.
APA
Wolfram Language. (2007). CoprimeQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CoprimeQ.html