show/hide this revision's text 2 deleted 374 characters in body

There is a primitive way to do it, given $n$.
You can of course an element of such a ring of integers can be written (non-uniquely, but this does not matter) as $\sum a_i\zeta_n^i$, and the absolute value then is $\sum_{i,j} a_ia_jcos(2\pi(i-j)/n)$. So just figure the relations in these cosine values over $\mathbb{Z}$ (for a specific value of $n$), and then write down some relations you need between the $a_i$'s and $a_j$'s to make sure you get an integer in the end.

For instance, for $n=3$ the cosine values are 1 and $\pm1/2$, so you just need to make sure that $a_0a_1+a_0a_2+a_1a_2$. For $n=5$ the possible values are $\frac{\sqrt{5}}{4} \pm \frac{1}{4}$, so you can write down some longer relation to make sure all the square roots cancel and all the denominators are cleared.

Of course, using a basis instead of a spanning-set simplifies these relations(for $n=3$ it makes $a_0a_1$ even the only relation), but it doesn't matter: you can just write the relations and then decompose any element this way and just check the relations.

Hope this helps.

show/hide this revision's text 1

There is a primitive way to do it, given $n$.
You can of course an element of such a ring of integers can be written (non-uniquely, but this does not matter) as $\sum a_i\zeta_n^i$, and the absolute value then is $\sum_{i,j} a_ia_jcos(2\pi(i-j)/n)$. So just figure the relations in these cosine values over $\mathbb{Z}$ (for a specific value of $n$), and then write down some relations you need between the $a_i$'s and $a_j$'s to make sure you get an integer in the end.

For instance, for $n=3$ the cosine values are 1 and $\pm1/2$, so you just need to make sure that $a_0a_1+a_0a_2+a_1a_2$. For $n=5$ the possible values are $\frac{\sqrt{5}}{4} \pm \frac{1}{4}$, so you can write down some longer relation to make sure all the square roots cancel and all the denominators are cleared.

Of course, using a basis instead of a spanning-set simplifies these relations (for $n=3$ it makes $a_0a_1$ even the only relation), but it doesn't matter: you can just write the relations and then decompose any element this way and just check the relations.

Hope this helps.