Ask Your Question

Amyamy's profile - activity

2023-01-31 05:02:03 +0200 received badge  Famous Question (source)
2022-10-21 12:55:37 +0200 received badge  Notable Question (source)
2021-11-17 16:23:01 +0200 received badge  Popular Question (source)
2021-01-27 13:21:24 +0200 received badge  Student (source)
2020-11-04 14:42:30 +0200 commented answer Finding irreducible polynomials in Sage Math

Okay, I changed R(f) to f, but now Sage always returns x. I want to find all the irreducible polynomials under a certain degree. How can I do this?

2020-10-29 14:03:33 +0200 asked a question Finding irreducible polynomials in Sage Math

I'm new to Sage and I'm asked to find out all the monic polynomials (of the form x^m+q) that are irreducible in the finite field $\mathbb{Z}/p\mathbb{Z}$. My idea is to vary q from 0 to p-1 and m from 1 to n, where n is the highest order of polynomials given by the user, and I want to create a function that works for all integer fields. However, my codes don't work and Sage tells me

positive characteristic not allowed in symbolic computations What does this mean?

def irr(p,n):
   R.<x>=PolynomialRing(Integers(p),'x')
   for m in range(n+1):
        for q in Integers(p):
            R(f)=x^m+q
            if R(f).is_irreducible():
                return R(f)