up previous next
CyclotomicIndex, CyclotomicTest    --    computes the index of a given cyclotomic polynomial


Syntax
CyclotomicIndex(F: RINGELEM): INT
CyclotomicTest(F: RINGELEM): INT

Description
The function CyclotomicTest takes the given polynomial F and returns the index n if it is the n-th cyclotomic polynomial; otherwise, it returns 0. To test whether a polynomial is cyclotomic, call CyclotomicTest, and check that the result is non-zero.

The function CyclotomicIndex is similar but faster. It is correct if the given polynomial is cyclotomic, but could potentially return a non-zero value even if the input polynomial is not cyclotomic.

Example
/**/  use R ::= QQ[x];
/**/  CyclotomicTest(x^6 +x^3 +1);
9
/**/  CyclotomicTest(x^4 -x^2 +2);
0

See Also