Define the ring of integers of a number field in sage.

1k Views Asked by At

I am new to sage and I searched the documentation, but could not find an answer for defining the ring of integers.

n = 7777
d = next_prime(n)
K.<a> = NumberField(x^2-d)

Now I want to define the ring of integers of the numberfield $K$. Is there a command which defines the ring of integers? Any suggestions how to do this?

1

There are 1 best solutions below

2
On BEST ANSWER

As one might guess, the ring of integers of K can be obtained as K.ring_of_integers().

One way to discover this is to type K.rin and then the TAB key to see what methods K has that start by rin. You will see the auto-completion to K.ring_of_integers.

sage: n = 7777
sage: d = next_prime(n)
sage: K.<a> = NumberField(x^2-d)
sage: O = K.ring_of_integers()
sage: O
Maximal Order in Number Field in a with defining polynomial x^2 - 7789