public List <Polynomial> FindAllPrimitiveRoots() { List <Polynomial> list = new List <Polynomial>(); var g = FindPrimitiveRoot(); list.Add(g); for (ulong i = 2; i < _cardinality - 1; i++) { var gcd = IntegerMath.Gcd(i, _cardinality - 1); if (gcd == 1) { var result = Pow(g, i); list.Add(result); } } return(list); }
public override BigInteger Gcd(BigInteger a, BigInteger b) => IntegerMath.Gcd(a, b);
public override long Gcd(long a, long b) => IntegerMath.Gcd(a, b);