galois.are_coprime¶
- galois.are_coprime(*values)¶
Determines if the arguments are pairwise coprime.
- Parameters¶
- *values : int or galois.Poly
Each argument must be an integer or polynomial.
- Returns¶
True
if the arguments are pairwise coprime.- Return type¶
Notes
A set of integers or polynomials are pairwise coprime if their LCM is equal to their product.
Examples
Determine if a set of integers are pairwise coprime.
In [1]: galois.are_coprime(3, 4, 5) Out[1]: True In [2]: galois.are_coprime(3, 7, 9, 11) Out[2]: False
Generate irreducible polynomials over \(\mathrm{GF}(7)\).
In [3]: GF = galois.GF(7) In [4]: p1 = galois.irreducible_poly(7, 1); p1 Out[4]: Poly(x, GF(7)) In [5]: p2 = galois.irreducible_poly(7, 2); p2 Out[5]: Poly(x^2 + 1, GF(7)) In [6]: p3 = galois.irreducible_poly(7, 3); p3 Out[6]: Poly(x^3 + 2, GF(7))
Determine if combinations of the irreducible polynomials are pairwise coprime.
In [7]: galois.are_coprime(p1, p2, p3) Out[7]: True In [8]: galois.are_coprime(p1*p2, p2, p3) Out[8]: False
Last update:
Feb 09, 2022