Deeper Arithmetic
For an odd prime : is a QR iff ; is a QR iff . Euler's criterion: .
Eleven odd primes up to have as a residue — exactly the primes that are sums of two squares (Fermat). Quadratic reciprocity then decides every by a Euclid-like descent. Olympiad use: showing an equation like has no solution for kills whole families of Diophantine equations mod a well-chosen prime.
has positive solutions in bijection with factorizations , , . For odd the count is when is a square, otherwise.
: , so solutions (the factorization gives and is excluded). For even both factors must be even, so has NO solutions — the standard parity obstruction. Every "sum/difference of squares" count is a divisor count in disguise.
jumps by at multiples of and by at multiples of , so some zero-counts () never occur. Euler: when — .
The smallest with at least trailing zeros is ( leaps from at to ). Euler plus CRT computes huge powers modulo composites: and give . Wilson's theorem handles factorials modulo primes; pairing each residue with its inverse is the proof.
Squares are and ; cubes are and ; fourth powers are . Powers of cycle with short periods mod small odd numbers. Before any heavy machinery, reduce a Diophantine equation modulo — one of them usually shows there are no solutions, or restricts them to a residue class you can then handle.
Show has no integer solutions.
Squares are or , so — never . Done in one line; the same idea shows no integer of the form is a sum of two squares.
Proofs & Why It Matters
For odd prime and : if is a QR, otherwise.
The multiplicative group mod is cyclic of order with generator ; write . Then , which is iff iff is even iff is a square (). Since , the value is a square root of , hence . The first supplement follows immediately: iff is even iff .
for every prime .
In the product , pair each residue with its multiplicative inverse mod . A residue is its own inverse iff iff (a polynomial of degree over a field has at most roots). All other residues pair off into products , leaving . Significance: the converse holds too ( composite for ), so Wilson characterizes primes — and the pairing trick reappears in every "product of all elements of a group" problem.
Going Deeper: Worked Problems
How many ordered pairs of positive integers satisfy ?
Step 1 — with both factors of the SAME parity; since is even, both must be even.
Step 2 — write , : with .
Step 3 — has divisors, so pairs with (no square root since is not a square).
Step 4 — each gives , : nine solutions. The parity step is where most attempts go wrong — an odd-times-even factorization of gives non-integer .
Show that is never divisible by for any positive integer .
Step 1 — the powers of mod cycle: (the order of mod is ).
Step 2 — so and — never .
Step 3 — the general principle: requires but , i.e. the order of mod is exactly — an EVEN order. Mod the order is , odd: impossible. This "order must be even" lemma settles every divisibility question.