Strategy
Hard number theory problems combine a few moves: reduce mod a well-chosen modulus to rule out solutions; factor (SFFT, difference of squares, sums of cubes); bound a variable by size or by the growth of a power; use orders to control exponents; and apply Fermat, Euler, Wilson or CRT to compute residues. Look for the invariant a modulus exposes.
Choose the modulus by what the equation contains: squares suggest mod or mod (squares are mod ; mod ); cubes suggest mod or (cubes are ); powers of suggest mod ; fourth powers mod . If a modulus leaves too many residues, try a product of small primes and reason with CRT. And know that some innocent equations resist every tool: whether has solutions beyond (Brocard's problem) is still open.
Find all with . Factor the right side: , and , so the equation becomes . The factorial grows much faster than : give against ; gives ; and from on, and the gap only widens. So : .
Show is never divisible by . The order of mod is (), so cycles through and through — never . Compare mod , where has order and : there exactly when .
Trusting a modulus that says nothing. For , reducing mod (squares ) allows as , and mod allows as . Silence is not evidence; move to mod , where the equation dies (next section).
Find all primes such that is also prime.
Show the answerHide the answer
For , , so , and is composite. Only remains, and is prime.
Choosing a Modulus
A modulus is useful when the terms of the equation take few values in it. Match the modulus to the exponent: lives in mod ; in mod and mod ; cycles with period mod and period mod . Several moduli, used in turn, can pin down exponents and parities one fact at a time.
The reason these particular moduli work is orders: mod every odd square is because the group of units mod has exponent ; mod every cube of a unit is because the units form a cycle of length and cubing collapses it to the two elements of order dividing . When one modulus yields a parity fact (" is even"), feed it back into the equation: an even exponent often means a difference of squares.
Show that has no integer solutions. Squares mod : , , , , — only . Sums of three of these: are all reachable, but is not. And . Impossible.
Solve in positive integers. If : , so . If : mod , , and since this forces even, . Now factor: , two powers of that differ by , so they are and : , , . Solutions: .
Find all primes with prime. gives , not prime; gives , prime. For a prime : is odd, so , and . The sum is and larger than : composite. Only .
Stopping at the first modulus that gives a partial answer. In , mod alone only shows is even; it rules nothing out. The finish needed a second tool — factoring the difference of squares — which the parity fact made available.
Find all for which is a perfect square.
Show the answerHide the answer
Mod : , and squares are , so must be even, . Mod : , but squares mod are and . So no works.
Floor Sums and Lattice Points
A sum of floors counts lattice points: is the number of points with , the points on or under the line above . For coprime : . Similarly : both count the points under the hyperbola .
The line from to cuts the box of interior lattice points into two halves. When no interior lattice point lies ON the line (that would need with ), and the half-turn symmetry about the centre of the box swaps the two halves, so each half holds exactly points. For the hyperbola, counting column by column gives points above , while counting the points with product exactly gives .
Directly: , total . As a count: these are the interior lattice points below the line from to . The interior box has points, none on the line since , and symmetry splits them evenly: .
Evaluate . The same points counted by their product : there are points with product , so the total is . This is the start of the study of the average number of divisors, which grows like .
Using the half-box formula when and share a factor. For , the "formula" gives — not even an integer. The line from to passes through the lattice point , which sits on the line and breaks the symmetric split.
Evaluate .
Show the answerHide the answer
, so the sum is . Directly: give ; give ; give ; total .
Why It Works
Pair with . For coprime and , is not an integer, so write with . Then , and , so . Each pair of terms therefore sums to . Adding all terms counts every pair twice: . This identity is the engine of Eisenstein's proof of quadratic reciprocity.