Maths Olympiad Prep

Library / Japan Mathematical Olympiad /61 of 84

Japan Mathematical Olympiad

Combinatorics Difficulty 7.2 National Olympiad, round 2 Prove it Japan

Let AA be the number of cases such that each cell of a 2021×20212021 \times 2021 table is filled with one of 11, 22, or 33 in such a way that any 2×22 \times 2 square in the table sums up to 88. Answer the remainder after dividing AA by 100100.

Solution

3\boxed{3}

For 1≤i≤20211 \le i \le 2021 and 1≤j≤20211 \le j \le 2021, let (i,j)(i, j) denote the cell in the ii-th row and the jj-th column, and let f(i,j)f(i, j) denote the number filled in (i,j)(i, j). We also define g(i,j)g(i, j) as
g(i,j)={f(i,j)(i+j is even),4−f(i,j)(i+j is odd). g(i, j) = \begin{cases} f(i, j) & (i + j \text{ is even}), \\ 4 - f(i, j) & (i + j \text{ is odd}). \end{cases}

It is easy to check that g(i,j)∈{1,2,3}g(i, j) \in \{1, 2, 3\} and gg satisfies, for 1≤i≤20201 \le i \le 2020 and 1≤j≤20201 \le j \le 2020,
g(i+1,j)−g(i,j)=g(i+1,j+1)−g(i,j+1).(∗) g(i+1, j) - g(i, j) = g(i+1, j+1) - g(i, j+1). \quad (*)
Indeed, since f(i,j)+f(i,j+1)+f(i+1,j)+f(i+1,j+1)=8f(i, j) + f(i, j + 1) + f(i + 1, j) + f(i + 1, j + 1) = 8, if i+ji + j is even,
g(i+1,j)−g(i,j)=(4−f(i+1,j))−f(i,j)=f(i+1,j+1)−(4−f(i,j+1))=g(i+1,j+1)−g(i,j+1) \begin{aligned} g(i+1, j) - g(i, j) &= (4 - f(i+1, j)) - f(i, j) \\ &= f(i+1, j+1) - (4 - f(i, j+1)) \\ &= g(i+1, j+1) - g(i, j+1) \end{aligned}
and if i+ji + j is odd,
g(i+1,j)−g(i,j)=f(i+1,j)−(4−f(i,j))=(4−f(i+1,j+1))−f(i,j+1)=g(i+1,j+1)−g(i,j+1). \begin{aligned} g(i+1, j) - g(i, j) &= f(i+1, j) - (4 - f(i, j)) \\ &= (4 - f(i+1, j+1)) - f(i, j+1) \\ &= g(i+1, j+1) - g(i, j+1). \end{aligned}
On the other hand, if we assign g(i,j)g(i, j) for 1≤i≤20211 \le i \le 2021 and 1≤j≤20211 \le j \le 2021 in such a way that g(i,j)∈{1,2,3}g(i, j) \in \{1, 2, 3\} and gg satisfies (*),
f~(i,j)={g(i,j)(i+j is even),4−g(i,j)(i+j is odd). \tilde{f}(i, j) = \begin{cases} g(i, j) & (i + j \text{ is even}), \\ 4 - g(i, j) & (i + j \text{ is odd}). \end{cases}
satisfies the restriction of the original problem. Hence, AA equals to the number of cases of defining g(i,j)g(i, j) under the above condition.

Let MM and mm denote the maximum and the minimum of {g(1,1),…,g(1,2021)}\{g(1, 1), \dots, g(1, 2021)\}, respectively. Having (*) for every 1≤i≤20201 \le i \le 2020 and 1≤j≤20201 \le j \le 2020 is equivalent to the condition that g(k+1,ℓ)−g(1,ℓ)g(k+1, \ell) - g(1, \ell) is constant for 1≤ℓ≤20211 \le \ell \le 2021 for each 1≤k≤20201 \le k \le 2020. We denote this constant value by dkd_k. Since 1≤g(i,j)≤31 \le g(i, j) \le 3 for every (i,j)(i, j) is equivalent to 1≤m+dk1 \le m + d_k and M+dk≤3M + d_k \le 3, or 1−m≤dk≤3−M1 - m \le d_k \le 3 - M, for every 1≤k≤20201 \le k \le 2020, there are (3+m−M)2020(3 + m - M)^{2020} possibilities for assigning g(i,j)g(i, j) when g(1,1),…,g(1,2021)g(1, 1), \dots, g(1, 2021) are given.

* M−m=0M - m = 0.

In this case we have g(1,1)=⋯=g(1,2021)g(1, 1) = \dots = g(1, 2021) and there are only 33 possibilities for (g(1,1),…,g(1,2021))(g(1, 1), \dots, g(1, 2021)). For each possibility, we have 320203^{2020} ways of assigning the rest of g(i,j)g(i, j), thus the number of cases is 3⋅32020=320213 \cdot 3^{2020} = 3^{2021}.

* M−m=1M - m = 1.

In this case we have m=1m = 1 or 22. For each mm, we have 22021−22^{2021} - 2 possibilities for (g(1,1),…,g(1,2021))(g(1, 1), \dots, g(1, 2021)). Thus, the number of cases is 2⋅((22021−2)⋅22020)=24042−220222 \cdot ((2^{2021} - 2) \cdot 2^{2020}) = 2^{4042} - 2^{2022}.

* M−m=2M - m = 2.

In this case we have 32021−2⋅(22021−2)−33^{2021} - 2 \cdot (2^{2021} - 2) - 3 possibilities for (g(1,1),…,g(1,2021))(g(1, 1), \dots, g(1, 2021)). Thus, the number of cases is (32021−2⋅(22021−2)−3)⋅12020=32021−2⋅(22021−2)−3(3^{2021} - 2 \cdot (2^{2021} - 2) - 3) \cdot 1^{2020} = 3^{2021} - 2 \cdot (2^{2021} - 2) - 3.

A=32021+(24042−22022)+(32021−2⋅(22021−2)−3)=2⋅32021+24042−22023+1. A = 3^{2021} + (2^{4042} - 2^{2022}) + (3^{2021} - 2 \cdot (2^{2021} - 2) - 3) = 2 \cdot 3^{2021} + 2^{4042} - 2^{2023} + 1.

To obtain the remainder after dividing AA by 100100, we compute A(mod4)A \pmod{4} and A(mod25)A \pmod{25}. Since 32021≡3(mod4)3^{2021} \equiv 3 \pmod{4}, we have A≡2⋅3+0−0+1≡3(mod4)A \equiv 2 \cdot 3 + 0 - 0 + 1 \equiv 3 \pmod{4}. And since 220≡320≡1(mod25)2^{20} \equiv 3^{20} \equiv 1 \pmod{25} from Euler's totient theorem,
A≡2⋅3⋅(320)101+22⋅(220)202−23⋅(220)101+1≡6+4−8+1≡3(mod25). A \equiv 2 \cdot 3 \cdot (3^{20})^{101} + 2^2 \cdot (2^{20})^{202} - 2^3 \cdot (2^{20})^{101} + 1 \equiv 6 + 4 - 8 + 1 \equiv 3 \pmod{25}.
This concludes that A≡3(mod100)A \equiv 3 \pmod{100}.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.