If Alice gives Bob m candies, then he'll have n times her candies; if Bob gives Alice n candies, then she'll have m times his candies.

tsuyakas1

tsuyakas1

Answered question

2022-09-06

If Alice gives Bob m candies, then he'll have n times her candies; if Bob gives Alice n candies, then she'll have m times his candies.
Alice and Bob have some different amount of candies (>1 each). If Alice gives Bob m candies, then Bob has n times the candies remaining to Alice, and if Bob gives Alice n candies, then Alice has m times the candies remaining to Bob.
How many candies have Alice and Bob?
I expected infinite solutions, but running a simple Python code (up to 200 iterations) gave me only 4 answers:
A B m n 7 5 3 2 14 4 8 2 11 5 7 3 11 7 8 5
Apparently the highest amount of candies that Alice/Bob can have is 14.
Does this limit actually exist? If so, how can I prove that?

Answer & Explanation

Vicente Macias

Vicente Macias

Beginner2022-09-07Added 15 answers

Step 1
If we solve the system of equations
{ b + m = n ( a m ) a + n = m ( b n )
for a,b in terms of m,n we get a = m + 1 + m 2 + m + n + 1 m n 1 and b = n + 1 + n 2 + m + n + 1 m n 1 . By symmetry, we may assume m n.
We want m 2 + m + n + 1 m n 1 to be an integer. This is easiest to achieve when m 2 + m + n + 1 m n 1 = 1. In this case, the equation m 2 + m + n + 1 = m n 1 gives us n = m + 2 + 4 m 1 , which only works out when m 1 is 1, 2, or 4. These correspond to ( m , n ) = ( 2 , 8 ), (3,7), and (5,8).
Step 2
It remains to check the cases where m 2 + m + n + 1 m n 1 2. Since m 2 m n, this requires m + n + 1 m n 2, or ( m 1 ) ( n 1 ) 4. This is true when m = 1, or for the pairs ( m , n ) = ( 2 , 2 ), (2,3), (2,4), (2,5), and (3,3). Moreover, when m = 1, we have a = 3 + 4 n 1 , limiting us to n = 2, 3, and 5.
We can check these finitely many cases and get only the following possibilities for (a,b): (4,14), (5,7), (5,11), (6,6), and (7,11) (together with the symmetric cases where a > b). Some of these work with multiple values of m and n: for example, a = b = 6 works either with m = n = 2 or with m = n = 3.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?