Integer Solutions and Linear Equations
Section titled “Integer Solutions and Linear Equations”A Diophantine equation asks for integer solutions. Integers are discrete, so factorization, divisibility, and bounds can be more useful than solving the equation over the reals.
The linear equation has integer solutions exactly when divides . If is one solution, all solutions are
Subtract two solutions to obtain ; after dividing by the GCD, coprimality forces the stated multiples.
Example. Find all nonnegative integer solutions of .
Modulo seven, , so . Write . Substitution gives . Nonnegativity requires from and from . Thus the only solution is .
Factorization and Divisor Pairs
Section titled “Factorization and Divisor Pairs”Rearranging an equation into a product converts infinitely many potential inputs into finitely many divisors. Adding a small constant can complete such a product.
Example. Find all positive integer ordered pairs satisfying .
Add one to both sides:
Both factors are at least two. The ordered factor pairs are and their reverses. Subtracting one from each coordinate gives
Every pair gives product after the shift and hence satisfies the original equation.
For a difference of squares, use . The two factors have the same parity; otherwise their half-sum and half-difference would not be integers.
Example. Find positive integers satisfying .
The positive factor pairs with the correct parity are . For factors and ,
This gives .
Modular Restrictions and Bounds
Section titled “Modular Restrictions and Bounds”Congruences eliminate impossible cases; inequalities can make the surviving casework finite. Neither tool alone must finish the problem.
Example. Find all positive integer pairs satisfying .
Positivity gives . The possible positive squares are . The only pair summing to is , so or .
A modular check supports the restriction: squares modulo four are zero or one, so exactly one variable is odd. The bound then finishes the search.
For symmetric equations, assume only after explaining that swapping coordinates recovers the other solutions. For reciprocal equations, ordering variables often turns the equation into an upper bound on the smallest one.
Pythagorean Triples
Section titled “Pythagorean Triples”A positive triple satisfying is primitive if its entries have no common factor greater than one. Every primitive triple, after possibly swapping the legs, has the form
where , , and have opposite parity. Nonprimitive triples are positive integer multiples of primitive ones.
To motivate the parametrization, a primitive triple has one odd and one even leg. Taking the odd leg to be gives
The two factors are coprime positive integers with a square product, so they are squares . Adding and subtracting recovers the formulas.
Example. Find all primitive Pythagorean triples whose hypotenuse is .
We need with . The only square pair is , giving . They are coprime and of opposite parity, so the triple is
with the two legs interchangeable. The triple also has hypotenuse but is not primitive.
Nonnegative Combinations of Two Integers
Section titled “Nonnegative Combinations of Two Integers”For coprime positive integers , the largest integer that cannot be written as with is . This is the two-denomination Frobenius or Chicken McNugget theorem.
One way to prove representability above the bound is to choose so . Such a choice exists because multiplication by permutes residues modulo . If , then ; being a multiple of , it must be nonnegative. The bound itself is not representable: a representation of would imply , forcing and making the left side exceed .
Example. Stamps come in values and . Find the largest nonnegative postage value that cannot be formed.
The values are coprime, so the largest gap is . As a direct check, are representable. Adding a four-cent stamp then proves every larger integer is representable as well, while cannot be formed.
Counting Nonnegative Linear Solutions
Section titled “Counting Nonnegative Linear Solutions”The general integer parametrization becomes a finite interval when the variables must be nonnegative. After finding one solution, write
For positive coefficients , the first inequality gives a lower bound on and the second an upper bound. Count the integers in the resulting interval, rather than searching a large rectangle of possible .
Example. Find the number of nonnegative integer solutions of .
Divide by six to get . Modulo three, , so write . Then . Nonnegativity gives , producing six solutions.
If positive rather than nonnegative variables were required, the endpoints would need to be checked again: here and each create a zero coordinate and would be excluded.
The count of integers in is . The added one includes both endpoints; it is a common source of an off-by-one error in parameter counts.
Ordering Variables in Reciprocal Equations
Section titled “Ordering Variables in Reciprocal Equations”For a symmetric equation in positive variables, order them to obtain bounds on the smallest one. A reciprocal sum is especially effective because implies .
Example. Find all positive integer triples satisfying .
First assume . Since the sum is at most , we have . The case is impossible because the other terms are positive.
If , both remaining reciprocals are at most one-third and must sum to two-thirds. Hence .
If , the remaining equation is . Completing a product gives
The positive factor pairs in increasing order are and . They yield and .
Thus the unordered triples are . All permutations of these triples satisfy the equation, and the ordering argument proves there are no others.
The bound on the smallest variable is the step that makes the search finite. Beginning with arbitrary divisor pairs in three variables would obscure this reduction.
For larger reciprocal equations, repeat the idea after fixing the smallest variable. Each remaining sum has fewer unknowns and an updated upper bound on the next smallest denominator.
Divisor Pairs and the Zero Boundary
Section titled “Divisor Pairs and the Zero Boundary”Difference-of-squares equations require factor pairs of matching parity. If the right side is an odd square, every positive factor pair has matching parity, but the equal pair gives a zero value for the smaller variable.
Example. Count positive integer pairs satisfying .
Factor , so it has fifteen positive divisors. There are seven unequal positive factor pairs and one equal pair, namely .
For each unequal pair , set and . Both are integers because the factors are odd, and . The equal pair would give and is forbidden.
Therefore there are seven pairs.
This count separates ordering from positivity. If negative variables were allowed or if ordered factor pairs were counted directly, the multiplicities would change. State the required domain before turning a divisor count into a solution count.
Integer-Valued Rational Expressions
Section titled “Integer-Valued Rational Expressions”When a polynomial quotient must be an integer, divide first. The polynomial part is automatically integral at integer inputs; only a small remainder can obstruct integrality.
Example. Find every integer such that is an integer.
Polynomial division gives
Thus must be a nonzero divisor of three: . The solutions are
Every listed value satisfies the original domain restriction, and each makes the remaining fraction an integer.
For a general integer polynomial and integer , division by leaves remainder . Thus is equivalent to when . If , the resulting finite divisor list can completely solve the problem.
If the remainder is zero, the quotient condition may hold for every allowed integer instead. Check that case rather than assuming a finite search always results.
Pythagorean Triples with a Fixed Perimeter
Section titled “Pythagorean Triples with a Fixed Perimeter”The primitive parametrization becomes more powerful when combined with a numerical constraint. Every positive Pythagorean triple, after interchanging the legs if necessary, has the form
with , coprime opposite-parity , and . Its perimeter is .
Example. Find all integer-sided right triangles with perimeter one hundred twenty.
The perimeter equation is . Since and , we have , so . The coprimality and parity conditions leave a short list.
For , the product is six, giving and sides . For it is fifteen, giving and sides . For it is twenty, giving and sides .
The other admissible products not exceeding sixty are twenty-eight, thirty-five, forty-five, and forty-two; none divides sixty. At , opposite parity forces and the product already exceeds sixty. Thus the three triangles listed are complete.
The conditions on prevent the same nonprimitive triangle from appearing through several parameter pairs. If those conditions are omitted, a search can still find examples but no longer has a clean uniqueness argument.
Bounding Between Consecutive Powers
Section titled “Bounding Between Consecutive Powers”Sometimes an expression is close enough to a square that factorization is unnecessary. Locate it strictly between consecutive squares or cubes.
Example. Prove that is not a perfect square for any positive integer .
Compare it with the squares of and :
The second strict inequality follows from for . Since no integer square lies strictly between consecutive integer squares, the expression cannot be one.
A successful bound must use consecutive integer powers. Showing an expression lies between two distant squares leaves other squares available and proves nothing. Also check strictness at the smallest admissible input; a boundary value can be the only exceptional solution.
Square Triangular Numbers and Pell Equations
Section titled “Square Triangular Numbers and Pell Equations”A triangular number is a square precisely when
Completing the square converts the mixed product into a Pell equation. The variable change is reversible: a solution with odd positive and nonnegative gives the original triangular-square solution.
The Pell classification for applies with . Its generated solutions have odd and even , so they produce all nonnegative triangular-square pairs. In the original variables, the update is
Starting from gives . Thus thirty-six and twelve hundred twenty-five are triangular squares, with indices eight and forty-nine.
The equation transformation alone constructs candidates. The completeness argument comes from the Pell descent, explained on the advanced Diophantine page. State that link when claiming an entire infinite family.
Prime Differences of Cubes
Section titled “Prime Differences of Cubes”A prime right side makes a factorization particularly restrictive, since its two positive factors must be one and the prime.
Example. Find all positive integers satisfying .
Factor:
The second factor exceeds one, so primality forces . Put . Then , giving . The positive root is four, so .
The other quadratic root is negative five and violates the specified domain. The positive pair verifies the original equation.
This method generalizes to differences of higher powers, but the remaining factor may be difficult to solve. The prime factorization reduces the problem; it does not automatically finish every exponent case. Retain the original positivity and ordering conditions throughout the reduction.
Reduce to Primitive Variables First
Section titled “Reduce to Primitive Variables First”A homogeneous equation often allows a common factor to be removed before any modular work.
Example. Prove has no positive integer solutions.
Write with and cancel . The equation implies , so coprimality forces . Similarly . Substitution would give , a contradiction.
The primitive reduction turns divisibility of a square into a forced unit. This elementary argument is shorter than a descent or a quadratic-discriminant search; try removing the GCD before choosing a more advanced method.