I want to define a function, that works like this:
f[3v[1,2,3]] = 1/3 v[1,3,2] + 3^2 v[1,2,3] f[2v[2,2,1]] = 1/2 v[2,1,2] + 2^2 v[2,2,1] Basically, it should affect coefficients before vectors and also permute indices. I've tried to look through references but was confused. Can you help me with that?