# Class numbers of cyclotomic fields

I wrote following program for finding out which ring of integers of cyclotomic fields are unique factorization domains:

```
max_limit=100
i=3
while i <= max_limit:
K=CyclotomicField(i)
O_K=K.ring_of_integers()
print(i , O_K in UniqueFactorizationDomains())
i=i+1
```

This gives me output as false for all numbers. But this wiki article suggests that there are bunch of them for which the class number is actually 1 i.e. the rings are unique factorization domains. I don't understand where I went wrong?

if you want the class numbers, ask for the class numbers.

I was not really interested in the class numbers. I just wanted to know what's going wrong.

You cannot expect that the categories are always the most precise possible, in particular when the decision possibly requires a serious amount of computation.

I don't really understand what you mean the categories not being precise?

Well, being an UFD is more precise than being a commutative ring. Categories are not being checked when being asked for, but defined once when the object is created. It would be expensive to always refine the category.