The quadratic form $x^2 + ny^2$ via prime factors Elementary algebra shows that the product of two numbers in the form $x^2 + ny^2$ again has the same form, since if $p = (a^2 + nb^2)$ and $q = (c^2 + nd^2)$, 
$$pq = (a^2 + nb^2)(c^2 + nd^2) = (ac \pm nbd)^2 + n(ad \mp bc)^2$$
My question is: Assuming that a number $z$ can be factored into primes of the form $x^2 + ny^2$, does every representation of $z$ in this form arise from repeated applications of this formula to the prime factors? 

Well, no. It is a fair question, though. Even with class number one, we can begin with $1 + 3 = 4,$ although $x^2 + 3 y^2$ does not represent $2.$ The way Dickson would have talked about this is the imprimitive form of the same discriminant, namely $2 x^2 + 2 x y + 2 y^2.$
Staying with one class per genus, we have $1 + 5 = 6,$ although $x^2 + 5 y^2$ does not represent $2,3.$ This is a different phenomenon called Gauss composition. The trick for this one is that $2 x^2 + 2xy+3 y^2$ does represent $2,3,$ and there is a different identity that allows $(2 a^2 +2ab+ 3 b^2)(2 c^2 +2cd+ 3 d^2) = x^2 + 5y^2. $ You should probably be able to find such an identity by hand.
One of the simplest ones where identifying the primes involved becomes a mess is $x^2 + 11 y^2.$ It is a bit of a problem (although solved) to say which primes can be expressed as $x^2 + 11 y^2$ and which by $3 x^2 + 2 x y + 4 y^2,$ among those primes $p$ for which the Jacobi symbol $(-11 | p) = 1.$ But, seeing as the latter form does represent $3,5$ integrally, we are not surprised to see $4 + 11 = 15.$ In this case, you ought to involve the "opposite" form in $(3 a^2 + 2 a b + 4 b^2)(3 c^2 - 2 c d + 4 d^2) = x^2 + 11 y^2.$ The presence of the opposite form is what makes the set (of three "classes") into a group.
Well, that's a start.
