ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 04 Oct 2021 13:48:48 +0200The meaning of arguments of is_primitivehttps://ask.sagemath.org/question/59234/the-meaning-of-arguments-of-is_primitive/ Say we have
R.<x> = PolynomialRing( GF(5) )
f = x^2 + 2*x +3
then we can use f.is_primitive() to tell if f is primitive. But is_primitive has two argument n and n_prime_divs. The document say
"n" (default: "None") - if provided, should equal q-1 where
"self.parent()" is the field with q elements; otherwise it
will be computed.
But this is whose 'self'? Is it the self of polynomial f? so n=4? I think here the n shall be 5^2-1. The following code will result in error.
f.is_primitive(4, [2])
but
f.is_primitive(5^2-1, prime_divisors(5^2-1))
will give the correct answer.zxlMon, 04 Oct 2021 13:48:48 +0200https://ask.sagemath.org/question/59234/