TITLE: Integers $d$ for which the negative Pell equation is soluble for both $d$ and $2d$?
QUESTION [11 upvotes]: Let $\text{NPE}_d$ denote the negative Pell equation:
$$ x^2-dy^2=-1$$
Where $d$ is a given positive nonsquare integer and integer solutions are sought for x and y.
we know that (in this paper
archive):

Theorem : The equation $\text{NPE}_d$ has integer solutions if and only if there exist two integers $a(d)=a$ and $b(d)=b$ such that $d=a^2+b^2$ and there exists a Pythagorean triplet $(A,B,C)$
such that $|aA-bB|=1$ and in this case $(Aa+Bb,C)$ is a solution.

Obviously if $\text{NPE}_d$ has integer solutions then $d$ cannot be divisible by any prime $p$ such that $p=3\mod 4$.

My question: Is there any characterization for the integers $d$ for which $\text{NPE}_d$ and $\text{NPE}_{2d}$ have both integer solutions.

I used the characterization above, but I can't link the couple $(a(d),b(d))$
to $(a(2d),b(2d))$ because the theorem doesn't give us much information
The sequence  of the elements $d$ for which $\text{NPE}_d$  is soluble is OEIS A031396.
I posted this question in math.exchange and does not receive any answer

REPLY [5 votes]: I know the question is old, but is possible to give an exact characterization to $d$, at least if it's a prime number:
It is known that considering a prime $p \equiv 1\mod 4$, there is always a solution to $x^2 - py^2 = -1$ in integers, the proof is from Mordell "Diophantine Equations" pages 55-56 (thanks to @Will Jagy for pointing that out).
Furthermore Dirichlet proved that if the prime $p \equiv 1 \mod 4$ and $p \equiv 5 \mod 8$ or $p \equiv 9 \mod 16$, the equation $x^2 - 2py^2 = -1$ has still integer solutions (reference: https://www.forgottenbooks.com/en/download/ThePellEquation_10024828.pdf pag. 80)
So you can say that if $p$ is a prime and $p \equiv 5 \mod 8$ or $p \equiv 9 \mod 16$ both NPEₚ NPE₂ₚ have integer solutions