Skip to main content
OlympiadHQ

Browse · MathNet

Print

The 4th Japanese Junior Mathematical Olympiad

Japan number theory

Problem

Let , be integers greater than . A grid is given. We want to write integers in each square so that (i) at least one of the entries are nonzero, and (ii) for each square , , where denotes the sum of the entry in all the squares which are next to (i.e., all the squares which share an edge with ). For example, let , . Assume that we write in all unit squares.
1111
1111
1111
If we write in each square, it shows
2332
3443
2332
and so in this way condition (ii) does not hold.

We call a good pair if we can write integers in the squares with conditions (i) and (ii). For example, consider the pair .
01
-10
By writing integers as above, the desired conditions indeed hold. Therefore is a good pair.

(1) Let . Find all integer such that is good pair. (2) Find the number of good pair such that . We consider ordered pairs, i.e., pairs and are considered different if .
Solution
Denote by the entry that lies in the th column. We will prove that is a good pair if and only if and are not relatively prime.

First, we prove that is a good pair for any integer . In fact, given a grid, write integers as and the desired condition holds.

Next, we prove is a good pair if and are not relatively prime. Let be the greatest common divisor of and . Since is a good pair, there exists a matrix which satisfies the required conditions. Then extend the domain of (as a function ) to by and then satisfies the required conditions.

Therefore, it suffices to prove that is not a good pair if and are relatively prime. Assume that we have written integers in the squares with condition (ii). It suffices to prove .

Extend the domain of (as a function ) to by Then it is clear that holds for all square .

Denote by the square on the th column. yields . Then yields . It follows that for any integer .

Now, let and be integers such that is even. Since and are relatively prime, there exist integers such that or, Then, follows from the periodicity of . Since , it follows by induction that for all such that is odd.

Since and are relatively prime, or is even. Assume that is even. Then, by symmetry, for even too, and follows for all and . Hence is not a good pair.

We can solve the problem using the results above.

(1) is a good pair if and only if and are not relatively prime, in other words, if is odd. So the answer is .

(2) One counts the number of pairs of integers such that and not relatively prime, and obtain the answer .
Final answer
(1) n = 3, 5, 7, 9. (2) 29

Techniques

Greatest common divisors (gcd)Functional equations