I guess that it is not the correct answer. Maybe I did not state my problem properly, so I will just give an exemple.
Let's say I have n=3 atoms and M=3 object. An object can contain at max nmax=2 atoms. Then the possible combinations are 111, 012, 021, 102, 120, 201, 210 (where xyz gives the...