Mazur, Barry (2010), “Algebraic numbers [IV.I]”, in Gowers, Timothy, The Princeton Companion to Mathematics, Princeton University Press, pp. 315--332, ISBN9781400830398 See in particular section 9, "Representations of Prime Numbers by Binary Quadratic Forms", p. 325.