Find the Number of ways of selecting 3 numbers from $\{1,2,3,\cdots,3n\}$ such that the sum is divisible by 3. (Numbers are selected without replacement).
I made a list like this:
The sum of all elements along such diagonals are divisible by 3. Number of ways of selecting such numbers is $3n-2$
Then I shifted the second row by one element and third row by one element behind second row:
Again the sum of elements are divisible by 3. Total number of ways is $3n-4$.
In the next list, I will shift the second row by two elements and third row by 2 elements behind second row. The elements along a diagonal will be $\{1,4,7\}\cdots\{3n-6,3n-3,3n\}$. Sum is divisible by 3. Number of such possibilities is $3n-6$.
The total number of ways is $3n-2+3n-4+3n-6+\cdots$
what will be the last case?