[Asking on behalf of a high school mathematics course, but responses written at any level are welcome!]

I was recently reading over a nice puzzle called the [**four points, two distances**](https://www.theguardian.com/science/2019/oct/21/did-you-solve-it-the-four-points-two-distances-problem) problem:

>Find all the ways to arrange $4$ points so that only $2$ distances occur between any two points.

The author of this piece, Alex Bellos, demonstrates with pictures that there are **six** such configurations. The explanation includes pictures of each of these six configurations, as well as a pointer back to writing from Colin Wright ([**link**](https://www.solipsys.co.uk/new/FourPointsTwoDistancesProof.html?RSS)) who links to the problem's formulation by Peter Winkler ([**link**](https://www.solipsys.co.uk/new/TheFourPointsPuzzle.html?FourPointsTwoDistancesProof)).

That question is about $n = 4$ points, for which the set of distances between point pairs has size $k = 2$, and the entire matter is situated in dimension $d = 2$. After assigning this problem to high school students with some success, we have come to wonder about what can be meaningfully observed for more general cases.

Our question, and most general formulation, is:

>In how many ways can you arrange $n$ points so that exactly $k$ distances occur between any two points in dimension $d$?

In this formulation, the original puzzle asserts that $(n,k,d) = (4,2,2)$ yields an answer of $6$.

Relevant resources that discuss this problem (or something related) are welcome, as are nontrivial statements that can be made about our general question. For example, are there nontrivial bounds that can be given for the case of $d=2$ as $n$ and $k$ vary?

Please edit and/or [re]tag if it will improve clarity!

-----

**Note:** As per the comments, one goal is to indicate how difficult this problem is when asked in such generality. So, responses that indicate how difficult a sub-question here is (e.g., [**MO 58203**](https://mathoverflow.net/q/58203) as pointed out by Gerry Myerson) will be great, too.