Given a fixed integer $N$ that is divided into $M$ (integer sized) pieces, I am looking for an expression which is closer to 1 when the sizes of the $M$ pieces are as equal as possible, and closer to $0$ when the size of the $M$ pieces are as different as possible.
For example, if $N = 12$ and $M = 2$, then $[6, 6]$ should have the largest value (closest to $1$) and $[1, 11]$ should have the smallest value (closest to 0).
As another example, if $N = 12$ and $M = 5$, then $[2, 2, 2, 3, 3]$ should have the largest value and $[1, 1, 1, 1, 8]$ should have the smallest value.
The values that $N$ can take on are $1, ..., 288$. $M$ can take on values between $1$ and $N$ if $N \le 144$, and is capped at $144$ if $N > 144$.
Before obtaining this indicator on [0,1], a good methodology is to have a way to compare partitions: "this partition is better than this one because...". Assume that we have:
$$N=a_1+a_2+ \cdots + a_M=a'_1+a'_2+ \cdots + a'_M,$$
I will consider the first partition to be "better" than the second one iff
$$\ \Pi_{k=1}^M a_k > \Pi_{k=1}^M a'_k.$$
Why is the product of constituents a good indicator ?
It is well known that for a fixed sum $N=a_1+a_2$, the maximum product $a_1a_2$ is obtained when $a_1=a_2$ ; one can reverse the process by saying that "the closer $a_1$ and $a_2$, the biggest their product". This can be extended in a straightforward manner to a partition of $N$ into $M$ components $N=a_1+a_2+ \cdots + a_M$ (see here).
See as well a connected issue in this answer to a question of mine. it could be of some help in order to find a normalization giving a full answer to your "quest" for an index belonging to interval $[0,1]$.
Edit Afterthought. This "indicator" should work well if $M$ is not too big compared to $N$, say for example $M/N < 1/3$. Otherwise, I would advise to use entropy, i.e., instead of $a_k$, consider $p_k=\frac{a_k}{N}$ (think to $p_k$ as a probability) and take as measure:
$$E=-\sum_{k=1}^M p_k \ln(p_k)=-\sum_{k=1}^M a_k \ln(a_k)+\ln(N) \tag{1}$$
(additive constant $\ln(N)$ can be ignored).
We can compare (1) with the indicator I advise before the "Edit". Indeed, by taking the logarithm, we maximize :
$$\sum_{k=1}^M \ln(a_k) \tag{2}$$
If all the $a_i$ are about the same "size", maximizing (2) or minimizing (1) are indeed equivalent.