I need to create a matrix where each element in the matrix will be on the same row as every other element exactly once. An example with the number 1-9 can look like this:
$\begin{bmatrix}2 & 4 & 8\\1 & 4 & 5\\ 4 & 7 & 9\\3 & 4 & 6\\1 & 2 & 3\\2 & 5 & 7 \\2 & 6 & 9\\1 & 8 & 9\\5 & 6 & 8\\3 & 7 & 8\\1 & 6 & 7\\3 & 5 & 9\end{bmatrix}$
The number 1 occur on the same row as every other number exactly once, and the same is true for every other number.
I need a matrix that has the same properties, but for 21 numbers. The requirements on the size of the matrix aren't set in stone, but should be around 3-6 columns and around 20 rows.
I have no idea how to approach this problem except by brute forcing manually so any help would be appreciated! This isn't a school problem either so if there is an easy way to simply generate the matrix that would be awesome to.
Thanks!