# Ticket #11516(new defect)

Opened 2 years ago

## zeta in modular integer ring is primitive

Reported by: Owned by: kedlaya was major sage-5.10 number theory modular arithmetic kcrisman N/A Kiran Kedlaya

### Description

Karl-Dieter Crisman (at Sage Edu Days 3) points out that the documentation of the zeta method for a modular integer ring is a bit misleading.

```sage: R = IntegerModRing(11)
sage: R.zeta(5, all=True)
[9, 5, 4, 3]
```

All well and good, but the documentation says:

```       Return an n-th root of unity in self if there is one, or raise an
ArithmeticError otherwise.

INPUT:

* ``n`` -- positive integer

* ``all`` -- bool, default: False.  If True, return a list of all
n-th roots of 1.
```

The point is that "n-th root of 1" should be "primitive n-th root of 1".

## Change History

### comment:1 Changed 2 years ago by kcrisman

Just a question - what happens for (say) n=4? Does it give two or three answers if one exists? (I'm really asking if it gives all non-1 roots, or truly only primitive roots.)

### comment:2 Changed 2 years ago by kedlaya

It only returns the primitive roots:

```sage: R = IntegerModRing(13)
sage: R.zeta(4, all=True)
[8, 5]
```

This is even true in corner cases:

```sage: R = IntegerModRing(13)
sage: R.zeta(1, all=True)
[1]
sage: R = IntegerModRing(1)
sage: R.zeta(1, all=True)
[0]
```

### comment:3 Changed 2 years ago by kedlaya

```sage: R = IntegerModRing(8)