File size: 2,821 Bytes
77a0a50 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #!/bin/sh
set -eu
PROOF=${PROOF:-/app/proof.md}
mkdir -p "$(dirname -- "$PROOF")"
cat > "$PROOF" <<'IMO_PROOF_d6d072e42f56f4d936889d3d49e613321b6dbc262b803d152ac81a2ca8343bd7'
The answer is that $a$ and $b$ are both even, or $a$ and $b$ are both odd and have the same remainder when divided by 4.
<Step 1> Finding an invariant
Let's observe how the remainder when divided by 4 changes under the operations. First, for odd numbers, both operations change the remainder as follows:
$1 \rightarrow 3,3 \rightarrow 1$
For even numbers, adding 2 changes the remainder as follows:
\[
0 \rightarrow 2,2 \rightarrow 0
\]
and multiplying by 3 changes the remainder as follows:
\[
0 \rightarrow 0,2 \rightarrow 2
\]
<Step 2> Finding impossible cases
<Step 2.1> From the observation in <Step 1>, we can find conditions on $a$ and $b$ for which the conclusion of the problem does not hold. Let's consider the following two cases:
<Step 2.2> (Case 1) $a$ and $b$ have different parity.
Since the parity of the two numbers does not change under the operations, the two numbers cannot become equal. Therefore, the answer is impossible in this case.
<Step 2.3> (Case 2) $a$ and $b$ are both odd and have different remainders when divided by 4.
Since odd numbers change their remainders when divided by 4 under each operation, the remainders of the two numbers when divided by 4 will always be different, regardless of the operations. Therefore, the answer is impossible in this case.
Now, let's prove that the answer is possible for $a$ and $b$ that do not satisfy (Case 1) and (Case 2).
<Step 3> Showing that the operations exist for the remaining cases.
<Step 3.1> The remaining cases are as follows:
(Case 3) $a, b$ are both odd and have the same remainder when divided by 4.
(Case 4) $a, b$ are both even.
<Step 3.2> First, let's show that we can make $a \equiv b(\bmod 4)$ for both cases by applying operations to $a$ and $b$. In (Case 3), $a \equiv b(\bmod 4)$ is already satisfied.
In (Case 4), if $a \neq b(\bmod 4)$, then by applying the operation of changing $a$ to $3a$ and $b$ to $b+2$, we can see that $3a \equiv b+2(\bmod 4)$. Therefore, we can make the two numbers congruent modulo 4.
<Step 3.3> Now, let's write the two numbers with the same remainder when divided by 4 as $x$ and $x+4n$. Let's add 2 to $x$ for $k$ times and then multiply it by 3. On the other hand, let's multiply $x+4n$ by 3 and then add 2 to it for $k$ times. As a result of the operations, $x$ becomes $3(x+2k)$ and $x+4n$ becomes $3x+12n+2k$.
Therefore, if we set $k=3n$, then the two numbers become equal.
[Short answer] $a$ and $b$ are both even, or $a$ and $b$ are both odd and have the same remainder when divided by 4.
IMO_PROOF_d6d072e42f56f4d936889d3d49e613321b6dbc262b803d152ac81a2ca8343bd7
|