On class numbers $h(-d)$ and the diophantine equation $x^2+dy^2 = 2^{2+h(-d)}$ Given fundamental discriminant $d \equiv -1 \bmod 8$ such that the quadratic imaginary number field $\mathbb{Q}(\sqrt{-d})$ has odd class number $h(-d)$. Is it true that one can always solve the diophantine equation,
$$x^2+dy^2 = 2^{2+h(-d)}\tag{1}$$
with odd integers $x,y$? 
For example, one can indeed solve,
$$x^2+7y^2 = 2^3$$
$$x^2+23y^2 = 2^5$$
$$x^2+47y^2 = 2^7$$
$$x^2+71y^2 = 2^9$$
which have $d$ with $h(-d) = 1,3,5,7$, respectively, and it is solvable for all such $d$ with $h(-d) \leq 25$ in the link given above (I tested them all), but it would be nice to know if it is true in general.
 A: Because $d=-1\pmod{8}$, $2$ splits in $K=\mathbb{Q}(\sqrt{-d})$. Let $\mathfrak{p}$ be a prime above $2$. Then $\mathfrak{p}^{h(-d)}$ is principal and has norm $2^{h(-d)}$. Let $z=x+\frac{1+\sqrt{-d}}{2}y$ be a generator, so $z$ has norm $2^{h(-d)}$. But this can be rewritten as $(2x+y)^2+dy^2 = 4\cdot 2^{h(-d)}$. Since $d$ is odd, $2x+y$ and $y$ are both odd unless $2$ divides $z$. But if it were so, $(2)$ would divide $\mathfrak{p}^{h(-d)}$ so $\bar{\mathfrak{p}}$ would divide $\mathfrak{p}^{h(-d)}$, which it does not (uniqueness of factorization).
A: Or, put the cheesy way: with $d = p \equiv 7 \pmod 8,$ there is a primitive positive quadratic form with coefficients $$ \langle 2, 1 , \frac{p+1}{8} \rangle.  $$ As a result, with class number $h,$ by repeated Gauss composition we know the principal form 
$$ \langle 1, 1 , \frac{p+1}{4} \rangle $$ integrally represents $2^h.$ Note that, from Theorem 4.12 on page 64 of Buell, the composition algorithm of Shanks,  as we continue with repeated Gauss composition, the middle coefficient remains  $\equiv 1 \pmod 4,$ which means that we are showing that the principal form primitively represents $2^h.$
Next, we have the same class number in the genus of $$\langle 1, 0 , p \rangle,  $$ although there is no longer a primitive form that represents $2$ itself.  Page 118, Theorem 7.5 (a) in Buell, Binary Quadratic Forms.
Finally,
$$ 4 (x^2 + xy +\frac{p+1}{4} y^2 )  = 4 x^2 + 4 x y + (p+1) y^2 = (2x+y)^2 + p y^2, $$ so we can represent $4 \cdot 2^h$ as $u^2 + p v^2.$
EDIT, Tuesday: Note that $x^2 + xy +\frac{p+1}{4} y^2$ and $u^2 + p v^2$ represent exactly the same odd numbers, as $\frac{p+1}{4}$ is even, so to get an odd number we have $x^2 + xy = x(x+y)$ odd, so $x$ is odd and $y$ is even; take $u=x, v = y/2.$
