6. How many lines of three adjacent cells can be chosen from this grid, horizontally, vertically or diagonally, such that the sum of the numbers in the three cells is a multiple of three?
A 30
B 24
C 18
D 12
E 6
SolUTION
B
Suppose first that in a line of three numbers, adjacent numbers have the same difference. Let $n$ be the first of these numbers, and $d$ be the common difference. Then these numbers are $n, n+d$ and $n+2 d$. The sum of these numbers is $3 n+3 d$ and therefore is a multiple of 3 .

Adjacent numbers in each row have a common difference 1. Therefore, the sum of the numbers in three adjacent cells in the same row is always a multiple of 3 .
There are two lines of three adjacent cells in each row, for example 1,2,3 and 2,3,4 in the top row.
Therefore, in the 4 rows there are $4 \times 2=8$ lines of three adjacent cells such that the sum of the numbers in these cells is a multiple of 3 .
Adjacent numbers in each column differ by 4 . Hence, it follows similarly, that there are 8 lines of three adjacent cells in the same column such that the sum of the numbers in these cells is a multiple of 3 .
We now consider the diagonals from top left to bottom right. Adjacent numbers in these diagonals each column differ by 5 . Therefore the sum of numbers in three adjacent cells in the same diagonal is always a multiple of 3 .
One of these diagonals contains 4 numbers. There are 2 lines of three adjacent cells in this diagonal whose sum is a multiple of 3 . There are 2 of these diagonals containing three numbers. Therefore, altogether, there are 4 lines of three adjacent numbers on theses diagonals whose sum is a multiple of 3 .
Similarly, on the diagonals from top right to bottom left adjacent numbers have a common difference 3 , and therefore there are 4 lines of three adjacent numbers on these diagonals whose sum is a multiple of 3 .
Hence, in total, there are $8+8+4+4=24$ lines of three adjacent cells whose sum is a multiple of 3 .