# Factoring an integer inside a ring of integers different from $\mathbb{Z}$

I am trying to find divisors of an element in the ring of integers of a Cyclotomic Field. My code is

K=CyclotomicField(23)
L=K.ring_of_integers()
L.factor(2)


It gives an error:

'AbsoluteOrder_with_category' object has no attribute 'factor'


I guess the problem is L is defined as an "order" here instead of a ring. But I need that to be a ring. How can I fix this problem?

edit retag close merge delete

( 2022-02-21 22:48:12 +0200 )edit

Sort by ยป oldest newest most voted

The ring of integers of the 23rd cyclotomic field is famously not a unique factorisation domain.

Once you have defined the cyclotomic field and its ring of integers,

sage: K = CyclotomicField(23)
sage: L = K.ring_of_integers()


the ring of integers does not have a factor method, as you noticed.

Its elements however do have such a method, but trying to factor L(2) hangs:

sage: L(2).factor()


and you have to interrupt it with Ctrl C.

One thing you can do is factor the ideal generated by 2.

sage: two = L.ideal(2)
sage: two.factor()
(Fractional ideal (2, zeta23^11 + zeta23^9 + zeta23^7 + zeta23^6 + zeta23^5 + zeta23 + 1)) * (Fractional ideal (2, zeta23^11 + zeta23^10 + zeta23^6 + zeta23^5 + zeta23^4 + zeta23^2 + 1))

more