I am looking to find real quadratic fields whose Hilbert class field is abelian over $\Bbb Q$. Then I learned about genus numbers and genus field of the number field. It is enough to find a number field whose class number is equal to the genus number. In [YOSHIOMI FURUTA article](https://projecteuclid.org/download/pdf_1/euclid.nmj/1118802021)  

I found the formula, but I have a problem with computing the order of the quotient.
So I was wondering, is there a way to find genus number using Sage just like the class number.


Any help is very appreciated



How to calculate genus number of number field using sage?
I may as well promote my comment to an answer, so this is closed. In a short paper, H. Hasse [1] computed the genus field and genus number of every real quadratic field. In particular, he shows that, given a real quadratic field $\Omega = \mathbb{Q}(\sqrt{d})$, the genus number of $\Omega$ is $2^{r-1}$, where $r$ is the number of distinct prime divisors of (the square-free) $d$. Thus, for example, the genus number of $\mathbb{Q}(\sqrt{210})$ is $8$, as $210 = 2 \cdot 3 \cdot 5 \cdot 7$.


Thus the genus number is (rather trivially) computable in Sage, for example by the command `2^(len(set(d.factor()))-1)`, where $d$ is as above.


[1] *Hasse, Helmut*, [**Zur Geschlechtertheorie in quadratischen Zahlkörpern**](http://dx.doi.org/10.2969/jmsj/00310045), J. Math. Soc. Japan 3, 45-51 (1951). [ZBL0043.04002](https://zbmath.org/?q=an:0043.04002).


