We define a set $S$ as all the integers of the form $x^2+d\cdot y^2$ for some positive integer $d$.
The question is the following: If $a \in S$ and some prime $p\in S$, such that $p|a$, then is $a/p \in S$?
I proved that for $a,b$ in $S$ then its product is also in $S$. But I don’t know how to start dealing with this problem. Any hint would be appreciated .