I'd like to replace every instance of L[stuff],
e.g.,
L[-1,-2,-2]
in an expression with x^(-FromDigits[{stuff}])
, e.g.
x^122
. But I'm running into an issue-- I'd like to do this with the code
L[-1, -2, -2] /. L[a___] -> x^(FromDigits[-{a}])
but this produces
2/x^6 + x^4 + x^5.
In trouble-shooting, I noticed that while
L[-1, -2, -2] /. L[a___] -> {a}
produces the output I expected, namely {-1,-2,-2}
, I found that
L[-1, -2, -2] /. L[a___] -> -{a}
just produces {4}
rather than {1,2,2}
. I must be misunderstanding how Sequence behaves when it shows up in the right side of a Rule since when I try just inputting -{Sequence[-1,-2,-2]}
I get the expected result {1,2,2}
. Does anyone see where I'm going wrong? Thanks!
L[-1, -2, -2] /. L[a___] :> x^(FromDigits[-{a}])
. $\endgroup$FullForm[-b]
was exactly the same as yours lol $\endgroup$