PValuationFiltration

Let p be a rational prime number. PValuationFiltration(R, p) returns the list of $R_i$, where

$\displaystyle R_i=\{s\in\{0,1,2,\cdots,d\}\mid p^i\mid n_{\sigma _s} \ \ \ $   and$\displaystyle \ \ \ p^{i+1}\nmid n_{\sigma _s}\}.$

For example,
gap> Valencies(R);       
[ 1, 1, 3, 3, 6, 6 ]
gap> PValuationFiltration(R, 2);       
[ [ 0, 1, 2, 3 ], [ 4, 5 ] ]
gap> PValuationFiltration(R, 3);
[ [ 0, 1 ], [ 2, 3, 4, 5 ] ]