[sage-support] Deriving an irreducible polynomial for F_2

2012-03-26 Thread Zimmermann Paul
Dear Clinton, all irreducible polynomials of degree n over GF(2) can be obtained by factoring x^(2^n)+x, and keeping only factors of degree n: sage: P. = GF(2)[] sage: factor(x^(2^5)+x) x * (x + 1) * (x^5 + x^2 + 1) * (x^5 + x^3 + 1) * (x^5 + x^3 + x^2 + x + 1) * (x^5 + x^4 + x^2 + x + 1)

Re: [sage-support] Deriving an irreducible polynomial for F_2

2012-03-21 Thread Martin Albrecht
Is this what you are looking for? sage: P. = GF(2)[] sage: f = P.random_element(degree=31) sage: f.is_irreducible() False sage: while f.degree() != 31 or f.is_irreducible() is False: : f = P.random_element(degree=31) : sage: f.is_irreducible() True sage: f.degree() 31