Question: How to reverse the operation of function map in a list?

Hi I wanna move the expressions except a^2 in the first term of p1 to after a^2 in the last term, and move the expressions except a^2+b^2 in the second term to after a^2+b^2 in the second-to-last term, etc., and achieve the reverse effect on p1 through  operation.

Maple code is as below (I add more letters in maple code compared to the above image)

with(ListTools)

p := map[scan = `+`](proc (x) options operator, arrow; x^3 end proc, [a, b, c, d, e, f, g, h, i, j, k])

[a^3, a^3+b^3, a^3+b^3+c^3, a^3+b^3+c^3+d^3, a^3+b^3+c^3+d^3+e^3, a^3+b^3+c^3+d^3+e^3+f^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3+k^3]

(1)

p1 := Reverse(p)

[a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3+k^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3, a^3+b^3+c^3+d^3+e^3+f^3, a^3+b^3+c^3+d^3+e^3, a^3+b^3+c^3+d^3, a^3+b^3+c^3, a^3+b^3, a^3]

(2)

nops(p1)

11

(3)
 

``

Download The_inverse_operation_of_map_on_the_elements_in_list.mw

Please Wait...