Let $n$ be a fixed positive integer. We have a $n\times n$ chessboard. We call a pair of cells good if they share a common vertex (May be common edge or common vertex). How many good pairs are there on this chessboard?
Problem
Source: 2021 Taiwan APMO Preliminary First Round
Tags: combinatorics
23.11.2020 04:59
Official answer:$2(n-1)(2n-1)$
23.11.2020 05:26
Nice problem For any vertex in the middle of the grid (not on the sides), there will be $\binom{4}{2}=6$ good pairs. There are $(n-1)^2=n^2-2n+1$ of these vertices, so the total will be $6(n-1)^2=6n^2-12n+6$. For vertices on the sides, and not the corners, there will be exactly $1$ good pair. There are $4(n-1)$ of these vertices, for a total of $4(n-1)=4n-4$ good pairs. For vertices on the corners, there will be no pairs that work. However, we overcounted all good pairs that share an edge. There are $\frac{8+12(n-2)+4(n-2)^2}{2}=4+6n-12+2n^2-8n+8 = 2n^2-2n$ of these. Thus the answer is $6n^2-12n+6+4n-4-2n^2+2n=4n^2-6n+2=(2n-2)(2n-1)$.
23.11.2020 07:15
The answer I submitted: We decided to count "globally" so we won't overcount. The good pairs should be like(sorry I don't know how to use asymptote) And their sum us clearly $2\times(n(n-1)+(n-1)^2)=2(2n-1)(n-1)$ as desired.
Attachments:

23.11.2020 08:53
Start from the top left corner. The top left corner square gives 3 good pairs. The square on the right of it gives 5 pairs including the one with the corner, so 4 new good pairs. Similarly, the one on the right of the second square also gives 4 new good pairs and so on until the second last square gives 4 new good pairs and finally the right corner square gives only 2 more new good pairs. To count the number of new good pairs in the second row, we notice that it is the same as counting the number of good pairs in the top row, which is $$3 + \underbrace{4 + 4 + \cdots 4 + 4}_{n-2} + 2$$Hence, the top $n-1$ rows give rise to $3 + \underbrace{4 + 4 + \cdots 4 + 4}_{n-2} + 2$ good pairs, whereas the last row gives only $n-1$ new good pairs as there is now row below it. Hence the answer is $(n-1)(3 + \underbrace{4 + 4 + \cdots 4 + 4}_{n-2} + 2) + n-1 = (n-1)(4(n-2) + 6) = \boxed{2(n-1)(2n-1)}$