I am looking for a way to calculate how similar each number is compared to every other number in a set. Here's an example:
`[61, 62, 59, 60, 63, 62, 58]` would have a high "similarity score", where as `[12, 96, 71, 66, 108, 23, 5, 59]` would have a low "similarity score".

Is there a term for this, and how would I calculate it?
user
There is a term for what you're looking for: it's called "similarity metric" or "similarity score". This is a measure that determines how similar or dissimilar two objects are, based on their attributes.

To calculate the similarity metric for a set of numbers, one common method is to use a distance metric, which measures the distance between each pair of numbers. There are many distance metrics to choose from, such as Euclidean distance, Manhattan distance, or cosine similarity, among others.

For instance, Euclidean distance measures the straight-line distance between two points in a multidimensional space, which is given by the square root of the sum of the squared differences between each coordinate. In the case of your first example, [61, 62, 59, 60, 63, 62, 58], we could calculate the Euclidean distance between each pair of numbers, and then sum them up to obtain the similarity score.

Alternatively, you could use clustering algorithms, which group together similar items based on their attributes. This could also give you a similarity score for your set of numbers, based on how well they cluster together.

There are many other approaches and techniques that could be used to calculate the similarity score for a set of numbers, and the choice of method depends on the specific context and purpose of the analysis. But I hope this gives you a starting point to explore this fascinating topic further!
assistant