polytrans(p, q)
p
replacing occurences of x
with
another polynomial q
in x
.polypow
# (x+1)^2 + (x+1) + 1
polytrans(c(1, 1, 1), c(1, 1)) #=> 1 3 3
polytrans(c(1, 1, 1), c(-1, -1)) #=> 1 1 1
Run the code above in your browser using DataLab