Calculating the class group of $\mathcal{O}_K$, for $K=\mathbb{Q}(\sqrt{7})$? How to calculate the class group of $\mathcal{O}_K$, for $K=\mathbb{Q}(\sqrt{7})$ without using the Minkowski bound?
 A: *

*You could show it is a norm-Euclidean domain.  If so, this would show the field has class number 1.

*You could use the class number formula, either in its general form or its special form for real quadratic fields, called the Dirichlet class number formula.  This will get you the class number, but not the class group per se.  But if the class number is 1 or prime, then you'll know the class group too.
Mathematicians think that it is likely that about 3/4 of the real quadratic fields have class number 1, so you can make an educated guess about what the class number likely is.
A: Let $p\not=2$ a prime number.
Since $[K:\mathbb{Q}]=2$, then happens one of the cases:
1) $(p)=\mathfrak{p}$,
2) $(p)=\mathfrak{p}^2$ or
3) $(p)=\mathfrak{p}\mathfrak{q}$,
where $\mathfrak{p}$ and $\mathfrak{q}$ are prime ideals;
If $\left(\frac{7}{p}\right)=-1$, then $(p)$ is prime in $\mathcal{O}_K$. If $\left(\frac{7}{p}\right)=1$, then exists $1\leq x\leq \frac{p-1}{2}$  s.t. $x^2-7=pn$, $n\in \mathbb{Z}$. But
$
|x^2-7|\leq x^2+7\leq \frac{(p-1)^2}{4}+7
$
 and 
$$
pn\leq \frac{(p-1)^2}{4}+7< p^2 \Longleftrightarrow p\geq 3.
$$
But $(p)=(p,x+\sqrt{7})(p,x-\sqrt{7})$ and since $(x+\sqrt{7})\subset \mathfrak{p}=(p,x+\sqrt{7})$, exists ideal $I$ s.t. $(x+\sqrt{7})= \mathfrak{p}I$. Thus
$$
p^2>pn=x^2-7=N(x+\sqrt{7})=N(\mathfrak{p})N(I)=pN(I),
$$
then $N(I)<p$.
In this case, using induction, $Cl(K)$ is generated by prime ideals $\mathfrak{q}$ s.t. $\mathfrak{q}\cap \mathbb{Z}=2\mathbb{Z}$.
Furthermore, $(2)=(2,1+\sqrt{7})^2$ and $(2,1+\sqrt{7})=(3+\sqrt{7})$. Then, $|Cl(K)|=1$.
A: Put another way, as there is no solution to $x^2 - 7 y^2 = -1$ or $x^2 - 7 y^2 = -4,$ we identify the indefinite quadratic forms $x^2 - 7 y^2$ with $-x^2 + 7 y^2$ to collapse two form equivalence classes into one field class. This is the Lagrange-Gauss cycle method for equating binary forms. Reduced forms $\langle a,b,c \rangle,$ meaning $f(x,y) = a x^2 + b xy+ c y^2,$ are precisely those with $b^2 - 4 a c = \Delta,$ here $\Delta = 28,$ then $ac < 0$ and $b > |a+c|.$ 

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./indefReduced
               2           2          -3
              -2           2           3
               3           2          -2
              -3           2           2
               1           4          -3
              -1           4           3
               3           4          -1
              -3           4           1
    jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./indefCycle 1 4 -3

  0  form              1           4          -3


           1           0
           0           1

To Return  
           1           0
           0           1

0  form   1 4 -3   delta  -1
1  form   -3 2 2   delta  1
2  form   2 2 -3   delta  -1
3  form   -3 4 1   delta  4
4  form   1 4 -3


  form   1 x^2  + 4 x y  -3 y^2 

minimum was   1rep   x = 1   y = 0 disc   28 dSqrt 5.2915026221  M_Ratio  28
Automorph, written on right of Gram matrix:  
2  9
3  14
=========================================
jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./indefCycle 3 4 -1

  0  form              3           4          -1


           1           0
           0           1

To Return  
           1           0
           0           1

0  form   3 4 -1   delta  -4
1  form   -1 4 3   delta  1
2  form   3 2 -2   delta  -1
3  form   -2 2 3   delta  1
4  form   3 4 -1


  form   3 x^2  + 4 x y  -1 y^2 

minimum was   1rep   x = 0   y = 1 disc   28 dSqrt 5.2915026221  M_Ratio  3.111111
Automorph, written on right of Gram matrix:  
2  3
9  14
=========================================
jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$


