permute all sequences and polynomial derivation