Simon's Favorite Factoring Trick

Simon's Favorite Factoring Trick (SFFT) (made by AoPS user ComplexZeta or Dr. Simon Rubinstein-Salzedo) is often used in a Diophantine equation where factoring is needed. It most commonly appears in equations such as $xy+66x-88y = 23333$ where there is a constant on one side of the equation and on the other side, a product of variables with each of those variables in linear terms.

Let's put it in general terms. We have an equation $xy+jx+ky=a$, where $j$, $k$, and $a$ are integer constants, and the coefficient of xy must be 1(If it is not 1, then divide the coefficient off of the equation.). According to Simon's Favorite Factoring Trick, this equation can be transformed into: \[(x+k)(y+j)=a+jk\] For example, $xy+66x-88y=23333$ is the same as: \[(x-88)(y+66)=(23333)+(-88)(66)\]

Here is another way to look at it.

Consider the equation $xy+5x+6y=30$.Let's start to factor the first group out: $x(y+5)+6y=30$.

How do we group the last term so we can factor by grouping? Notice that we can add $30$ to both sides. This yields $x(y+5)+6(y+5)=60$. Now, we can factor as $(x+6)(y+5)=60$.

This is important because this keeps showing up in number theory problems. Let's look at this problem below:

Determine all possible ordered pairs of positive integers $(x,y)$ that are solutions to the equation $\frac{4}{x}+\frac{5}{y}=1$. (2021 CEMC Galois #4b)

Let's remove the denominators: $4y+5x=xy$. Then $xy-5x-4y=0$. Take out the $x$: $x(y-5)-4(y-5)=0+20$ (notice how I artificially grouped up the $y$ terms by adding $4\cdot5=20$).

Now, $(x-4)(y-5)=20$ (you can just do SFFT directly, but I am guiding you through the thinking behind SFFT). Now we use factor pairs to solve this problem.

Look at all factor pairs of 20: $1\cdot20, 2\cdot10, 4\cdot5, 5\cdot4, 10\cdot2, 20\cdot1$. The first factor is for $x$, the second is for $y$. Solving for each of the equations, we have the solutions as $\boxed{(5, 25), (24, 6), (6, 15), (14, 7), (8, 10), (9, 9)}$.

More info on the solution


Applications

This factorization frequently shows up on contest problems, especially those heavy on algebraic manipulation. Usually $x$ and $y$ are variables and $j,k$ are known constants. Sometimes, you have to notice that the variables are not in the form $x$ and $y.$ Additionally, you almost always have to subtract or add the $x, y,$ and $xy$ terms to one side so you can isolate the constant and make the equation factorable. It can be used to solve more than algebra problems, sometimes going into other topics such as number theory.

Problems

Introductory

  • Two different prime numbers between $4$ and $18$ are chosen. When their sum is subtracted from their product, which of the following numbers could be obtained?

$\mathrm{(A) \ 22 } \qquad \mathrm{(B) \ 60 } \qquad \mathrm{(C) \ 119 } \qquad \mathrm{(D) \ 180 } \qquad \mathrm{(E) \ 231 }$

(Source)

Intermediate

  • If $kn+54k+2n+108$ has a remainder of $3$ when divided by $5$, and $k$ has a remainder of $1$ when divided by $5$, find the value of the remainder when $n$ is divided by $5$.

$\mathrm{(A) \ 1 } \qquad \mathrm{(B) \ 0 } \qquad \mathrm{(C) \ 4 } \qquad \mathrm{(D) \ 2 } \qquad \mathrm{(E) \ 3 }$

- icecreamrolls8

    • We have solution $\boxed{(D)}$. Note that $kn+54k+2n+108$ can be factored into \[(k+2)(n+54)\] using Simon's Favorite Factoring Trick. Now, look at n. Then, since the problem tells us that $k$ has a remainder of $1$ when divided by 5, we see that the $(k+2)$ factor in the $(k+2)(n+54)$ expression has a remainder of $3$ when divided by 5. Now, the $(n+54)$ must have a remainder of $1$ when divided by $5$ as well [3(mod5) x 1(mod5) = 3(mod5)] matching the main expression which has a remainder of $3$ when divided by $5$. Therefore, since 54 has a remainder of $4$ when divided by $5$, $n$ must have a remainder of $2$, so that the entire factor has a remainder of $1$ when divided by $5$.

- icecreamrolls8

  • $m, n$ are integers such that $m^2 + 3m^2n^2 = 30n^2 + 517$. Find $3m^2n^2$.

(Source)

  • A rectangular floor measures $a$ by $b$ feet, where $a$ and $b$ are positive integers with $b > a$. An artist paints a rectangle on the floor with the sides of the rectangle parallel to the sides of the floor. The unpainted part of the floor forms a border of width $1$ foot around the painted rectangle and occupies half of the area of the entire floor. How many possibilities are there for the ordered pair $(a,b)$?

(Source)

Olympiad

  • The integer $N$ is positive. There are exactly $2005$ ordered pairs $(x, y)$ of positive integers satisfying:

\[\frac 1x +\frac 1y = \frac 1N\]

Prove that $N$ is a perfect square.

Source

See Also

External Links