Question: Assigning unique values to each occurance of an indeterminant in an Expression

suppose for example i am working on the function

exp(-I*Pi*(n+2*n*(m-1))/m);

and i wanted to for what ever reason assign a unique symbol to each of the two times the indeterminant 'n' occurs:

exp(-I*Pi*(n[1]+2*n[2]*(m-1))/m)

How could i accomplish this for any function F?

i have tried the method of

map(op, [op(op(exp(-I*Pi*(n+2*n*(m-1))/m)))]);
                [-1, Pi, n, 2 n (m - 1), m, -1]
 

And though i could then use algsubs on the original function for each in the above list, but then ran into problems arising that for any function the number of times i need to map op in iteration is not known, i will actually work this out by the end of the night so i dont know why im bothering asking

 

Edit 2: yep its ok i discovered subsop

Please Wait...