Since Gauss's publication of Disquisitiones Arithmeticae in 1801, mathematicians have been interested in the divisibility properties of class numbers. However, still today many of the properties of class numbers remain mysterious. In this talk we will discuss recent work on the divisibility by 3 of class numbers of quadratic fields. It is conjectured that the 3-part of the class number of the quadratic field $Q(\sqrt{D})$ (i.e. the size of the 3-torsion subgroup) may be bounded above by an arbitrarily small power of $\vert D\vert$. However, until recently, the only known bound was the trivial bound for the class number itself, $O(\vert D\vert^{1/2 + \varepsilon})$.

Bounding the 3-part can be reduced to the problem of counting the number of squares of the form $4x^3 - dz^2$, where $d$ is a square-free positive integer, and $x$ and $z$ are integers in the ranges $x \ll d^{1/2}$, $z\ll d^{1/4}$. This counting problem is nontrivial because of the disproportionate ranges of the variables. We show that using a variant of the square sieve in combination with the q-analogue of van der Corput's method allows one to tackle such a counting problem successfully, giving a nontrivial upper bound for the 3-part of class numbers of quadratic fields. This new method of counting integer points is quite general, and has recently been used by Heath-Brown to give an upper bound for the size of discriminants of imaginary quadratic fields whose class group can have exponent 5.