Question: Remove the permutation

Hi all, i have a problem someone help me.

Define per(f(a,b,c)) = {f(a,b,c), f(b,c,a), f(c,a,b)}. I want to write a function removePer() that removes the permutations, example:

ds := {a, b, a^2, b^2, c, c + 2a, a - b, c^2, a + 2b, b + 2c}

then removePer(ds) return {a, a^2, c + 2a, a - b} because per(a) = {a, b, c}, per(a^2)  = {a^2, b^2, c^2} and per(c+2a) ={a+2b, b+2c, c+a}. Note that removePer(ds) can return {b, a^2, c + 2a, a - b} or {c, a^2, c + 2a, a - b}, ...  but just one result.

ds := {ab, bc, a - b^2, b - c^2, a^2, c - a^2},

then removePer(ds) return {ab, a - b^2, a^2}.

Thank you very much.

Please Wait...