Application of ideal class group? I know what the class group is but I could not come up with any setting where we need to know what the class group actually is.
Does anyone know of an example where we have two number fields with the same class number but different class group, and the difference in class group lets us only use one of them for a number theory problem?
I can think of one example where different class number matter, but the class group is much more subtle.
 A: Your question is why the class group structure matters and not just the class number. 


*

*Computations of the class number, if that were all you cared about at first, can be made more efficient by simultaneously computing the class group structure. See Henri Cohen's first book on computational algebraic number theory. 

*Cohen and Lenstra developed a probabilistic model, based on weighting each finite abelian group by the reciprocal of the size of its automorphism group, to explain trends in numerical tables of class numbers. For example, up to isom. there are two groups of order 9: the cyclic one and a product of two groups of order 3. The first group of order 9 has 6 automorphisms and the second group of order 9 has 48 automorphisms. Reciprocating, the cyclic group gets weight 1/6 and the non-cyclic group gets weight 1/48. Note 1/48 is smaller than 1/6 and in fact it takes a lot longer in tables to find an imag. quad. field with class number 9 whose class group is not cyclic. Of course this might not seem relevant to your question, since a problem about class groups is not a satisfactory example to illustrate why we need to know about class groups rather than class numbers. So consider the following purely "class number" question: how often does a real quadratic field have class number divisible by 5? Cohen and Lenstra provide heuristics that should answer this question, and the point is that the idea behind their heuristic is to study all possible finite abelian group structures of each size and weight them in a suitable way.

*As Xue says in a comment, class field theory provides a good example where class group structure matters, e.g., the fields Q(sqrt(-14)) and Q(sqrt(-30)) both have class number 4, but the first has cyclic class group and the second has class group that's a product of two groups of order 2. This means the number of quadratic unramified extensions of the two fields is not the same, since nonisom. groups of order 4 have different numbers of subgroups (equivalently, quotient groups) of order 2. More generally, class field theory tells us that class groups are Galois groups, and surely you appreciate that Galois theory is a lot more than theorems about the sizes of Galois groups! Moreover, class field theory says that any finite abelian extension of a number field $K$ has Galois group over $K$ which is (naturally) isomorphic to a generalized ideal class group of $K$. Only the abelian unramified extensions of $K$ are related to the ideal class group itself; you need generalized ideal class groups of $K$ to access the ramified abelian extensions. The moral is that you should think about the ideal class group merely as the most basic example of generalized ideal class groups, which taken all together tell you what the group structure of the maximal abelian extension of $K$ looks like. In more fancy language, the generalized ideal class groups are replaced by the group of ideles, and in the geometric setting of global fields with positive characteristic, generalized ideal class groups are replaced by generalized Jacobians to describe finite abelian extensions.

*At the end of http://www.math.uconn.edu/~kconrad/blurbs/gradnumthy/matrixconj.pdf I discuss how to find an example of a 2 x 2 integral matrix which is not conjugate to its transpose over the integers. (Note that any square matrix over a field is conjugate over that field to its transpose, and that is why it's interesting to see an example where the conjugation breaks down over the integers.) The problem reduces to finding an ideal class group with an element of order greater than 2. The first imaginary quadratic field with class number greater than 2 is Q(sqrt(-14)): the class number is 4. But that's not enough to assure you that this can lead to a desired non-conjugate-transposed-matrix-over-Z example, since whether or not a group of size 4 has an element of order greater than 2 depends on the structure of the group. Of course you can simply bypass this and use the field Q(sqrt(-23)), which has class number 3, but the point is that Q(sqrt(-14)) has cyclic class group, so it really contains an ideal class of order greater than 2 and in that .pdf file I use such an ideal class to construct the desired 2 x 2 integral matrix not conjugate to its transpose.
A: Let's generate a few prime numbers.
Last time I tried to show off the $n^2-n+41$ formula for prime numbers it did not go well. Everyone said it was old hat, known since Euler. After this debacle I then decided to try a couple formulas of my own:

*

*$n^2+14$


*$n^2+30$
Of course, neither one is going to give $n^2-n+41$ a run for its money; formula (1) is bound to fail for multiples of $2$ or $7$ and (2) will have problems with multiples of $2,3,5$. But what if I use only values of $n$ that are prime to the constant term?
Formula (1) gives:
$1^2+14=15$
$3^2+14=\color{blue}{23}$
$5^2+14=39$
$9^2+14=95$
Well, that is largely a dud, maybe formula (2) will work a little better with appropriate values of $n$:
$1^2+30=\color{blue}{31}$
$7^2+30=\color{blue}{79}$
$11^2+30=\color{blue}{151}$
$13^2+30=\color{blue}{199}$
$17^2+30=319(=11×29)$
Although only four primes are produced before we run into composite numbers, this result is clearly better than the one with $n^2+14$. The latter requires going all the way up to $n=33$, using fifteen values of $n$ that are prime to $14$, to give four primes. Surely my audience will appreciate the fact that the $n^2+30$ form is associated with a quadratic domain with class number 4, and so I did not resort to a UFD.
Or did I?
Pulling two and two apart
Why does $n^2+30$ generate prime numbers more efficiently for small $n$ than $n^2+14$?
Both $\mathbb Z[\sqrt{-14}]$ and $\mathbb Z[\sqrt{-30}]$ have class number 4, but there the similarity ends: the former has class group $\mathbb Z/4\mathbb Z$, whereas the latter has instead $\mathbb Z/2\mathbb Z×\mathbb Z/2\mathbb Z$.
As I explain here, when a domain has a class group consisting only of two-cycles -- like the Klein four-group for $\mathbb Z[\sqrt{-30}]$ but unlike the cyclic four-group for both $\mathbb Z[\sqrt{-14}]$ and $\mathbb Z[\sqrt{-17}]$ -- it can be augmented with numbers having the form
$k\sqrt{a}+m\sqrt{b}$
for properly constructed values of $a$ and $b$ and $k,m$ either both integers or in some cases both half-integers. With $\mathbb Z[\sqrt{-30}]$ we use three augmentations, all with $k$ and $m$ both integers:
$k\sqrt{15}+m\sqrt{-2}$
$k\sqrt{10}+m\sqrt{-3}$
$k\sqrt6+m\sqrt{-5}$
When these are overlaid on the $\mathbb Z[\sqrt{-30}]$ domain, all elements of the latter factor uniquely. For instance, $34$ is both $2×17$ and $(2+\sqrt{-30})(2+\sqrt{-30})$, but with the augmented domain as defined above these are both resolved into the unique factorization $(-1)(\sqrt{-2})^2(\sqrt{15}+\sqrt{-2})(\sqrt{15}-\sqrt{-2})$.
Because of this modified version of unique factorization in a Klein-four class group domain, $n^2+30$ is forced to have factors with one of the forms
$15k^2+2m^2, 10k^2+3m^2, 6k^2+5m^2.$
When we set $n$ prime to $30$,the most obvious factors having these quadratic forms are excluded and, resembling $n^2-n+41$ after all, a rather large value of the function is needed to find other factors (for $319$, the factors are $6(1^2)+5(1^2)$ and $6(2^2)+5(1^2)$).
My audience should be impressed by this mathematical ingenuity!
