1
$\begingroup$

Given e.g.

  f := a[1]*a[2]+a[1]*a[3]+a[2]*a[3] 

Now we want to substitute a[i]->i, I tried

   applyrule(a[i] = i, f)    applyrule(a =[seq(i, i = 1 .. nops(a))], f)   

and replace "applyrule" above with "subs" and "algsubs" commands. But none works.

Any idea?

1 Answers 1

2

You could try something like

eval(f, a=[$1..3]);