Inspired by this Puzzling SE question: All distances different on a chess board.
Introduction
Lets define a sequence \$a(n), n\geqslant 1\$ as how many pawns can you put on a \$n \times n\$ chessboard in such a way that all the distances between two pawns are different.
- Pawns are placed always in the centre of the square.
- The distance is simple Euclidean distance.
Example
\$a(4)=4\$:
1100
0000
0010
0001
Challenge
This is a standard sequence challenge and the default rules apply.
This is also code-golf, so the shortest code per language wins!
Test cases
First 9
terms:
1,2,3,4,5,6,7,7,8
.
Some more: A271490.
Trivia/hints
- \$a(n) \leqslant n\$
- \$a(n)\$ is weakly increasing, ie. \$a(n) \leqslant a(n+1)\$
len(set(p*p+q*q for p in range(100) for q in range(100)))
) And \$ 3664<C(87, 2) \$. So \$a(100)<87\$. \$\endgroup\$