For any integer $n \ (n \geq 2)$, is there a way to construct $2n$ points $(x_1, y_1), (x_2, y_2), \cdots, (x_{2n}, y_{2n})$ with following conditions?
- For every integer $i \ (1 \leq i \leq 2n)$, $x_i$ and $y_i$ are integers between $1$ and $n$
- Every points are different, i.e. for every integers $1 \leq i < j \leq 2n$, it satisfies $x_i \neq x_j$ or $y_i \neq y_j$
- For every integers $i, j, k \ (1 \leq i < j < k \leq 2n)$, $(x_i, y_i), (x_j, y_j), (x_k, y_k)$ are not collinear
Small-case examples:
If $n=2$, if points are $(1, 1), (1, 2), (2, 1), (2, 2)$, it satisfies all conditions.
If $n=3$, if points are $(1, 1), (1, 2), (2, 1), (2, 3), (3, 2), (3, 3)$, it satisfies all conditions.
If $n=4$, if points are $(1, 1), (1, 2), (2, 3), (2, 4), (3, 1), (3, 2), (4, 3), (4, 4)$, it satisfies all conditions.
Is there some construction for all $n$, including $n \geq 5$? If there are, how to construct?
It is an open problem to find a specific $n\gt 1$ where it is impossible to choose $2n$ points of an $n\times n$ grid with no three collinear. (By an obvious pigeonhole argument one can never get more than $2n$ points of the grid.)
The comments and references for OEIS A000769 give a summary of what is known about this problem, attributed to Henry Dudeney in 1917.
Solutions (with $2n$ points on an $n\times n$ grid, no three in a line) have been found for $n=2,\ldots,46$ and $n=48,50,52$, for which the Reader is referred to Achim Flammenkamp's web site The No-Three-in-Line Problem. Summary counts of known solutions for $n$, especially considering those with dihedral symmetries, are in this text table there. An illustration is used for $n=24$ with left-right symmetry:
These solutions were found by combinatorial search (a branch-and-bound algorithm) taking advantage of specified symmetries. Some constructive methods are known that provide less than $2n$ points for arbitrarily large $n$. P. Erdös noted that for prime $n$, the $n$ points $(x,x^2)\bmod n$ form a set with no three collinear points (because this is a quadratic "curve"). Later Hall, Jackson, Sudberry, and Wild (J. Comb. Th. Ser. A v. 18, 1975, pp. 336 - 341) extended this to construct $3n/2$ points with no three collinear when $n$ is twice a prime.
So we know that the maximum number of points we can feasibly choose in an $n\times n$ grid is between $(3n/2\; - \epsilon)$ and $2n$. Guy and Hall (1968) gave a heuristic argument and conjectured that as $n$ tends to infinity, the maximum number of points is asymptotic to $cn$ where $c=\pi/\sqrt{3}\approx 1.8138$.
See these notes from a talk by Nathan Kaplan (2016) for a sketch of those latter developments (around the middle of the presentation).