Theorem 6
For

a squarefree integer, the equation

has a solution
in integers if and only if it has a solution modulo

.
Proof.
By multiplicativity, it suffices to show that

has a solution
for

,

, and

for

an odd prime such that

is congruent
to a square modulo

. For

, use

; for

,
use

.
Now suppose

is an odd prime such that

is congruent to a square
modulo

. Find

such that

is divisible by

but not
by

(if it is divisible by

, fix that by replacing

with

). Now form the ideal

. Its norm divides

and

, so it must be

.