Given a random permutation $\pi$ of {1,2,...,n}, I want to produce a list {a1,a2,...,an} of nonnegative integers so that ai is the number of cycles in $\pi$ of length i for each i=1,2,...,n. For example, in the permutation below I would like the list {2,1,0,0,0,1,0,0,0,0} indicating that there are 2 fixed points, 1 cycle of length 2 and 1 cycle of length 6.
In[16]:= RandomPermutation[10]
Out[16]= Cycles[{{1, 4, 10, 7, 3, 5}, {2, 6}}]