Problem

Source: Baltic Way 2015

Tags: combinatorics, Baltic Way



Let $n>2$ be an integer. A deck contains $\frac{n(n-1)}{2}$ cards,numbered \[1,2,3,\cdots , \frac{n(n-1)}{2}\]Two cards form a magic pair if their numbers are consecutive , or if their numbers are $1$ and $\frac{n(n+1)}{2}$. For which $n$ is it possible to distribute the cards into $n$ stacks in such a manner that, among the cards in any two stacks , there is exactly one magic pair?