For which $n\in\Bbb N$ can we divide $\{1,2,3,...,3n\}$ into $n$ subsets each with $3$ elements such that in each subset $\{x,y,z\}$ we have $x+y=3z$?

Solution 1:

If there is a solution for $N$, then there is a solution for $7N+5$.
The solution for $N$ uses up numbers from $1$ to $3N$. Then $$(3N+k, 15N+9+2k, 6N+3+k), k=1..3N+3\\ (12N+8+k,15k+10+2k,9N+6+k), k=1..3N+2$$ sits the numbers from $3N+1$ to $21N+15$ on top of them.

EDIT

In the same way, there is also a solution for $7N-3$.
$$(3N+1+k,15N-4+2k,6N-1+k),k=0..3N-3\\ (12N-4,15N-5+2k,9N-3+k),k=0..3N-2$$

I have started a new question for a different version at Split $\{1,2,...,3n\}$ into triples with $x+y=4z$ and also Split $\{1,...,3n\}$ into triples with $x+y=5z$ - no solutions?

Solution 2:

Here is the integer linear programming approach I used to find partitions for all such $n\le 496$ with $n \equiv 0,5 \pmod 8$. First enumerate all triples $\{x,y,z\}$ with $x+y=3z$ and $x,y,z$ distinct elements of $[3n]:=\{1,\dots,3n\}$. For each such triple $T$, let binary decision variable $u_T$ indicate whether $T$ appears in the partition. The constraints $$\sum_{T:\ i\in T} u_T = 1 \quad \text{for $i\in[3n]$} \tag1$$ enforce that each element appears exactly once in the partition.

An alternative approach is to introduce nonnegative slack variables $s_i$, replace the set partitioning constraints $(1)$ with (set covering and cardinality) constraints \begin{align} \sum_{T:\ i\in T} u_T + s_i &\ge 1 &&\text{for $i\in[3n]$} \tag2 \\ \sum_T u_T &= n \tag3 \end{align} and minimize $\sum_{i=1}^{3n} s_i$. A partition of $[3n]$ into $n$ triples with $x+y=3z$ exists if and only if the optimal objective value is $0$.