# Computer program for factorization into irreducible polynomials over $\mathbb{Z}_{p^k}$

Hensel's Lemma allows us to factor a polynomial uniquely into basic irreducible factors over $\mathbb{Z}_{p^k}$. Is there a SAGE or Magma command that gives this factorization? Or can anyone help in writing a small script that handles this problem? Thanks in advance.

• I think this question, technically speaking, counts as a programming question? – awllower Dec 26 '14 at 14:59
• Maybe a small script can handle this?.. Not a complicated program. Maybe.. Someone working on Z_p^k may have some information about this. – S.B. Dec 26 '14 at 15:02
• It might be worth looking into a CAS like Maxima or Maple. – flawr Dec 26 '14 at 15:05
• You probably mean $\mathbb{Z}_{p^k}$ and not $\mathbb{Z}_p^k$ ? – Alexander Konovalov Feb 26 '15 at 23:49
• Right, of course, I edited, thanks. – S.B. Feb 27 '15 at 5:36

For example, you can do this with GAP, using Factors:

gap> f:= CyclotomicPolynomial( GF(2), 7 );
x_1^6+x_1^5+x_1^4+x_1^3+x_1^2+x_1+Z(2)^0
gap> Factors( f );
[ x_1^3+x_1+Z(2)^0, x_1^3+x_1^2+Z(2)^0 ]
gap> Factors( PolynomialRing( GF(8) ), f );
[ x_1+Z(2^3), x_1+Z(2^3)^2, x_1+Z(2^3)^3, x_1+Z(2^3)^4,
x_1+Z(2^3)^5, x_1+Z(2^3)^6 ]


(see GAP manual here for the documentation of Factors).

• P.S. Of course, GAP is not the unique system capable of doing this, but one of the advantages of doing this in GAP is that it's open-source (as well as Sagemath and Maxima suggested in comments by others). – Alexander Konovalov Feb 26 '15 at 23:54
• Thank you in advance. I have usen GAP several times when dealing with Group Theory, and I follow also the GAP forum, but I haven't thought that it might have been handy in factoring polynomials. Thank you. – S.B. Feb 27 '15 at 5:41
• Thanks, glad to see you on this site too! – Alexander Konovalov Feb 27 '15 at 9:31