## Integral bases for quadratic fields

Hi,

I was wondering if you could just clarify how you determine $O_K.$ In most quadratic examples it seems to be $Z(\sqrt{n})$, however in some it is $Z((1+\sqrt{n}/2))$. I think it must have something to do with the integral basis?