The Brahmagupta identity $(x^2+ry^2)(z^2+rt^2)=(xz-ryt)^2+r(xt+yz)^2=(xz+ryt)^2+r(xt-yz)^2$ shows that for an arbitrary fixed $r$ the set numbers of the form $x^2+ry^2$ is closed under the operation of multiplication.
Let $p,r;x,y∈\mathbb{Z}$. Find all pairs $(p,r)$ such that, for fixed $p$ and $r$, the set of numbers of the form $px^2+ry^2$ is closed under multiplication.
If $p=l(la^2+kb^2)$ and $r=k(la^2+kb^2)$ (all variables are integers), then the set of numbers of the form $px^2+ry^2$ is closed under the operation of multiplication. To check, it suffices to use the Brahmagupta identity twice:
$$(l(la^2+kb^2)x^2+k(la^2+kb^2)y^2)(l(la^2+kb^2)z^2+k(la^2+kb^2)t^2)=$$
$$=(la^2+kb^2)(la^2+kb^2)(lx^2+ky^2)(lz^2+kt^2)=$$
$$=l(la^2+kb^2)(laxz-kayt-kbxt-kbyz)^2+k(la^2+kb^2)(laxt+layz+lbxz-kbyt)^2.$$
I failed to prove that other pairs $(p,r)$ do not exist.