Originally Posted by

**Jose27** If $\displaystyle d \equiv 1 mod4$ we have that there exists $\displaystyle p\in \mathbb{Z}$ such that $\displaystyle d=4p+1$ and so $\displaystyle (1+\sqrt{d} )(1- \sqrt{d} )= 1-(4p+1)=-4p$ and this last one has a factorization in integers since it's even.

If $\displaystyle d<-2$ and $\displaystyle d$ odd then $\displaystyle (1+\sqrt{d} )(1- \sqrt{d} ) = -d+1$ and this one is even and so it has non-trivial factorization in integers. If $\displaystyle d$ is even take $\displaystyle (2+\sqrt{d} )(2-\sqrt{d} )$