Let $n \ge 3$ be a positive integer. Determine, in terms of $n$, how many triples of sets $(A,B,C)$ satisfy the conditions: $\bullet$ $A, B$ and $C$ are pairwise disjoint , that is, $A \cap B = A \cap C= B \cap C= \emptyset$. $\bullet$ $A \cup B \cup C= \{ 1 , 2 , ... , n \}$. $\bullet$ The sum of the elements of $A$, the sum of the elements of $B$ and the sum of the elements of $C$ leave the same remainder when divided by $3$. Note: One or more of the sets may be empty.
Problem
Source: Rioplatense Olympiad 2014 level 3 P1
Tags: Sets, remainder, number theory, combinatorics