Triples with even intersection Let $\mathfrak M=\{M_1, \ldots , M_s\}$ be a collection of triples of natural numbers from $1$ to $n$, such that $|M_i \cap M_j| \ne 1$ (or, equally, $|M_i \cap M_j|$ even for $i \ne j$. How large can be $s(n)=\max s$ for $n$?
I can prove that $s(n) \leq n$: consider $\mathbb Z_2$-vector space with basis $x_i$ for $1 \leq i \leq n$ and take vector $\phi(M)=\sum_{i \in M} x_i$ for $M \in \mathfrak M$. Then vectors $\phi(\mathfrak M)$ are orthogonal, so linearly independent, and so $s \leq \dim$.
But this upper bound is not exact: a few combinatorics shows that $s(5)=4$.
 A: If all triplets are disjoint there are at most $n/3$ of them which is clearly not optimal as we can construct $n-2$ of them by taking all triples that contain $\{1,2\}$. 
So consider two triples that are not disjoint, w.l.o.g. take $\{1,2,3\}$ and $\{1,2,4\}$. We distinguish two cases:


*

*$\{2,3,4\}$ or $\{1,2,4\}$ is in $\mathfrak{M}$: in this case, each triple $A$ that intersects $\{1,2,3,4\}$ is a subset of $\{1,2,3,4\}$ and there are at most $4$ of those. There are at most $s(n-4)$ triples that do not intersect $\{1,2,3,4\}$, so we find $s(n) \leq s(n-4) + 4$.

*$\{2,3,4\}$ and $\{1,2,4\}$ are not in $\mathfrak{M}$: in this case, each triple $A$ that intersects $\{1,2,3,4\}$ contains $1$ and $2$. Suppose there are $c-2$ such triples and let them be $\{1,2,3\}$, $\{1,2,4\}$, ..., $\{1,2,c\}$. It is easy to see that there cannot be any more triples intersecting $\{1,2,...,c\}$, so it follows that $s(n) \leq c-2 + s(n-c)$.
We have $s(1)=0$, $s(2)=0$, $s(3)=1$ and $s(4)=4$. By induction, it is now easy to show that $s(n)=4\lfloor n/4 \rfloor$ if $4 \nmid n+1$ and $s(n)=4\lfloor n/4 \rfloor+1$ otherwise. This is achievable, since for $n=4k+\ell$ with $\ell \leq 3$ we can take all triples that are subsets of one of the sets $\{1,2,3,4\}$, $\{5,6,7,8\}$, ... $\{4k-3,4k-2,4k-1,4k\}$ (there are $4k$ of those) together with the triplet $\{4k+1,4k+2,4k+3\}$ when $\ell=3$.
