  We establish a novel connection between algebraic number theory and knot
theory. We show that the number of equivalence classes of integral binary
quadratic forms of discriminant $t^2 - 4$ (for $t\neq \pm 2$) is equal to the
number of isotopy classes of links in $\mathbb{S}^3$ with prescribed values
(depending on $t$) of three classical link invariants. The equality arises from
a natural algebraic correspondence between integral binary quadratic forms (of
discriminant $t^2 - 4$ for $t\neq \pm 2$) and isotopy classes of links of braid
index at most three. In particular, the class numbers of certain quadratic
number fields precisely measure the failure of the Alexander/Jones polynomial
to distinguish non-isotopic links of braid index at most three.
