Three strategies for integer problems: factorization, modular arithmetic, and bounds

Original publication:

What you will learn

Three useful starting points for integer problems, when to use each one, and how to write complete solutions.

How do you start an integer problem?

Integer problems can seem to depend on a flash of inspiration. I struggled with them as a high-school student too. A more practical starting point is to ask which of the following approaches the conditions suggest:

  1. Factorization: turn an equation into a product and use its divisors.
  2. Modular arithmetic: compare the possible remainders of both sides.
  3. Bounds: reduce infinitely many candidates to a finite list.

These are useful strategies rather than an exhaustive classification of number theory. A single problem may require more than one.

Factorization: exploit divisors

Factorization is especially promising when primes, prime powers, or coprime integers appear. A prime pp has only the positive divisors 11 and pp. If a product equals a power of a prime, each positive factor must itself be a power of that prime.

For example, an equation of the form (x−a)(y−b)=N(x-a)(y-b)=N reduces to checking factor pairs of NN. Remember to include negative factors when the original variables are allowed to be negative.

Modular arithmetic: exploit remainders

When factorization does not help, look for a modulus that restricts one side strongly. An integer square is congruent to either 00 or 11 modulo 44, and to either 00 or 11 modulo 33. These small observations are often enough to rule out whole families of candidates.

The symbol a≡b(modm)a\equiv b\pmod m means that a−ba-b is divisible by mm.

Bounds: make the search finite

An inequality or the condition that a variable must be real can impose an upper bound on an integer. Once only finitely many possibilities remain, check them carefully.

For a symmetric expression, it is often useful to order the variables first. Then ask: which variable cannot be too large? If the smallest variable is already large, all the others are at least as large, which may contradict the required inequality.

Example 1: similar equations, different starting points

Find all pairs of positive integers (k,n)(k,n) satisfying each equation:

  1. 3n=k3+13^n=k^3+1.
  2. 3n=k2−403^n=k^2-40.

The first equation has a sum of cubes on the right, suggesting factorization. The second involves a square; working modulo 44 will make factorization possible later.

Solution to part 1

Factorizing gives

3n=(k+1)(k2−k+1).3^n=(k+1)(k^2-k+1).

Since k+1≥2k+1\ge2 is a positive divisor of 3n3^n, write

k+1=3l,1≤l≤n.k+1=3^l,\qquad 1\le l\le n.

Substitute k=3l−1k=3^l-1 into the second factor:

k2−k+1=32l−3l+1+3=3(32l−1−3l+1).k^2-k+1=3^{2l}-3^{l+1}+3=3(3^{2l-1}-3^l+1).

The integer in parentheses is congruent to 11 modulo 33, so this factor is divisible by 33 exactly once. Comparing powers of 33 in the product gives n=l+1n=l+1. Consequently,

32l−1−3l+1=1,3^{2l-1}-3^l+1=1,

so 3l(3l−1−1)=03^l(3^{l-1}-1)=0. Hence l=1l=1, k=2k=2, and n=2n=2.

Conversely, 32=23+13^2=2^3+1. Therefore the only solution is

(k,n)=(2,2).\boxed{(k,n)=(2,2).}

Solution to part 2

Work modulo 44. If kk were even, k2−40≡0k^2-40\equiv0, whereas 3n≡13^n\equiv1 or 33. Thus kk is odd. Then k2−40≡1k^2-40\equiv1, so nn must be even.

Write n=2mn=2m, where mm is a positive integer. Now the equation factorizes:

(k−3m)(k+3m)=40.(k-3^m)(k+3^m)=40.

Since k2=32m+40k^2=3^{2m}+40, we have k>3mk>3^m. Both factors are therefore positive and even, with the second larger than the first. The only possibilities are

(k−3m,k+3m)=(2,20)or(4,10).(k-3^m,k+3^m)=(2,20)\quad\text{or}\quad(4,10).

The first gives k=11k=11 and 3m=93^m=9, hence m=2m=2. The second gives k=7k=7 and 3m=33^m=3, hence m=1m=1. Both satisfy the original equation. Thus

(k,n)=(11,4), (7,2).\boxed{(k,n)=(11,4),\ (7,2).}

The key lesson is that modular arithmetic and factorization can work together: the remainder calculation exposes a difference of squares.

Example 2: a parity proof using squares modulo 4

Problem. Let x,y,z,wx,y,z,w be positive integers with

x2+y2+z2=w2.x^2+y^2+z^2=w^2.

Prove that at least two of x,y,zx,y,z are even.

Choosing a method

The conclusion concerns parity, while the equation contains squares. Modulo 44 is more informative than modulo 22: every even square has remainder 00, and every odd square has remainder 11.

Complete solution

Modulo 44, each term among x2,y2,z2x^2,y^2,z^2 is 00 or 11, and w2w^2 is also 00 or 11.

If exactly two of x,y,zx,y,z were odd, the left side would have remainder 22. If all three were odd, it would have remainder 33. Both are impossible.

Therefore at most one of x,y,zx,y,z is odd. Equivalently, at least two are even.

Example 3: count integer triples by bounding the smallest variable

Problem. How many ordered triples of distinct positive integers (l,m,n)(l,m,n) satisfy

1l+1m+1n>85?\frac1l+\frac1m+\frac1n>\frac85?

Choosing a method

The inequality is symmetric. First assume l<m<nl<m<n, count the increasing triples, and then account for their permutations. If ll were too large, every reciprocal would be small, so bound ll first.

Complete solution

For l<m<nl<m<n,

85<1l+1m+1n<3l,\frac85<\frac1l+\frac1m+\frac1n<\frac3l,

which gives l<15/8l<15/8. Since ll is a positive integer, l=1l=1. Hence

1m+1n>35.\frac1m+\frac1n>\frac35.

Since 1<m<n1<m<n, the left side is less than 2/m2/m, so m<10/3m<10/3. Therefore m=2m=2 or m=3m=3.

  • If m=2m=2, then 1/n>1/101/n>1/10, so 2<n<102<n<10. There are seven possibilities: n=3,4,5,6,7,8,9n=3,4,5,6,7,8,9.
  • If m=3m=3, then 1/n>4/151/n>4/15, so 3<n<15/43<n<15/4. There is no integer in that interval.

There are seven increasing triples. Each has three distinct entries and therefore 3!=63!=6 different permutations. The required number of ordered triples is

7×6=42.\boxed{7\times6=42.}

The word ordered matters: if permutations were considered the same, the answer would be seven.

A checklist for your next problem

Look for a product when primes or divisibility appear. Try a small modulus when powers or parity appear. If neither immediately resolves the problem, look for inequalities that force a finite search. Always substitute the surviving candidates into the original conditions to establish that they really are solutions.

For a different kind of method selection, see how symmetry simplifies probability recurrences.

Related articles

About the author

Koki Saito

Physician and graduate of the University of Tokyo Faculty of Medicine. Drawing on his entrance-exam experience, he explains how to choose mathematical methods and construct complete solutions.

Full profile →

Have a question or spotted an error? Contact us.