How many triples $(x, y, z)$ of positive integers satisfy both

(i) $x+y+z$ is a multiple of 3 , and

(ii) $1 \leq x \leq 10,1 \leq y \leq 10$, and $1 \leq z \leq 10$ ?
An important observation for this problem is that every integer has a remainder of either 0,1 , or 2 when it is divided by 3 . That is, every integer is either a multiple of 3 , one more than a multiple of 3 , or two more than a multiple of 3 . Suppose $x+y+z$ is a multiple of 3 .

If $x$ is a multiple of 3 , then $y+z$ is also a multiple of 3 . There are three ways this can happen: both $y$ and $z$ are multiples of $3, y$ is one more than a multiple of 3 and $z$ is two more than a multiple of 3 , or $y$ is two more than a multiple of 3 and $z$ is one more than a multiple of 3 .

If $x$ is one more than a multiple of 3 , then $y+z$ must be two more than a multiple of 3 . Again, there are three ways that this can happen.

We summarize the possible remainders after $x, y$, and $z$ are divided by 3 (either 0,1 , or 2 ) that will lead to $x+y+z$ being a multiple of 3 :

| $x$ | $y$ | $z$ |
| :--- | :--- | :--- |
| 0 | 0 | 0 |
| 0 | 1 | 2 |
| 0 | 2 | 1 |
| 1 | 0 | 2 |
| 1 | 1 | 1 |
| 1 | 2 | 0 |
| 2 | 0 | 1 |
| 2 | 1 | 0 |
| 2 | 2 | 2 |

Of the integers from 1 to 10 inclusive, 3, 6, and 9 are multiples of 3 (a total of three), 1, 4, 7, and 10 are one more than a multiple of 3 (a total of 4), and 2, 5, and 8 are two more than a multiple of 3 (a total of 3 ).

Thus, for example, there are $3 \times 3 \times 3=27$ triples $(x, y, z)$ so that $x+y+z$ is a multiple of 3 and each of $x, y$, and $z$ is a multiple of 3 .

Computing the total for each row in the table above, we have

| $x$ | $y$ | $z$ | Number of Triples |
| :---: | :---: | :---: | :---: |
| 0 | 0 | 0 | $3 \times 3 \times 3=27$ |
| 0 | 1 | 2 | $3 \times 4 \times 3=36$ |
| 0 | 2 | 1 | $3 \times 3 \times 4=36$ |
| 1 | 0 | 2 | $4 \times 3 \times 3=36$ |
| 1 | 1 | 1 | $4 \times 4 \times 4=64$ |
| 1 | 2 | 0 | $4 \times 3 \times 3=36$ |
| 2 | 0 | 1 | $3 \times 3 \times 4=36$ |
| 2 | 1 | 0 | $3 \times 4 \times 3=36$ |
| 2 | 2 | 2 | $3 \times 3 \times 3=27$ |

which means the total is $2(27)+64+6(36)=54+64+216=334$.