I want to find a function F to represent the positions of identical elements in a list, which means, for example:
F[{5,6,5,7}]={{1,3},{2},{4}}F[{5,6,6,5}]={{1,4},{2,3}}F[{5,7,5,5}]={{1,3,4},{2}}F[{5,6,7,8}]={{1},{2},{3},{4}}F[{5,5,5,5}]={{1,2,3,4}}
etc. Is there any function or implementation?
Moreover, I want to use this into an $\underbrace{n\times n\times\cdots\times n}_m$ Table t[n_,m_] (so the dimension $m$ is also an input of t), such that
t[[i_1,...,i_m]]=Subscript[x,F[{i_1,...,i_m}]]
where $1\le i_1,\cdots,i_m\le n$. How can I implement it?
Thanks :)


