Brute force not working

I don’t really understand the brute force solution here.

If we can pick any value of x that’s positive and greater than 1, why am I getting different answers for x+y for different x values?

Can anyone try this out and let me know where i’m going wrong here?


You can’t

So this would work for any x value that’s an integer greater than 1, and that would result in y being an integer greater than 1?

Is that the catch?

No, there are only two (x,y) that work. Specifically, (x,y) = (6,2) and (x,y) = (2,6).

You can’t just pick any positive integer values of x (besides 1 and the ones listed above) because you’ll end up with a non-integer value for y.

“Brute force” means listing all possible (x,y) pairs and determining which one works. The catch is that you only need to find a single valid pair—since it’s a multiple‑choice question, that implies the sum x+y is the same (invariant) for any other (x,y) pairs.

How did you figure out (2, 6) and (6, 2) are the only right pairs?

We can just keep finding y values by assuming x to be different numbers right?

Since this is a PS question we can do it quickly after finding one pair, but what if this was a QC question

Adding 1 to both sides gives you:

(x + 1)(y + 1) = 21

Now if you let z = x + 1 and t = y + 1 with the previously established constraints on x and y, then you have that z and y are integers greater than 2.

As a result, z can only be either 3 or 7; likewise, y can also just be 3 or 7, depending on the value of z.

Finally, undoing the substitution above results in either (x,y) = (6,2) or (x,y) = (2,6)