I want to create a neat table of the factorization of several polynomials 
of the form [image: x^n-1] in the ring Z/3Z [x]. 

This is my code, which I am using inside of a Jupyter notebook that works 
as expected:

R = IntegerModRing(3) 
x = PolynomialRing(R, 'x').gen()

rows  = []
for k in range(1,10):
    f = x^k - 1
    factor = f.factor()
    rows.append((f,factor))

table(rows, header_row=["Polynomial ", "Factorization"], frame=True)

However, the output produced is ugly and looks like the one in the 
attachment; it leaves a lot of space on the right but the factorization is 
spread across multiple rows. How can I ask Sage to place each factorization 
in the right column on a single line. 

Also is it possible for me to write [image: x^k-1] for various powers of 
[image: 
k] in latex in place of [image: x^k+2]. i.e. I want to write -1 wherever 
there is a 2 in the left column. Sure I can do this with print, but the 
output won’t be Latex rendered. 

​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/8e6ac426-311f-4ab6-82e2-0be392d866dfn%40googlegroups.com.

Reply via email to