Help:=proc(): print(`F(n,K), Fs(n,K), FnK(n,K), EvalC(L,x,x0), EvalDC(L,x,x0), EvalMC(L,x,x0), EvalMC1(n,m,x,x0,F)`): end: Fs:=proc(n,K) : if n=0 or n=1 then 1: else Fs(n-1,K)+Fs(n-2,K) mod K: fi: end: F:=proc(n,K) option remember: if n=0 or n=1 then 1: else F(n-1,K)+F(n-2,K) mod K: fi: end: FnK:=proc(n,K) local i,P: P:=[0,1]: for i from 1 to n do P:=[P[2],P[1]+P[2] mod K]: od: P[2]: end: #EvalC(L,x,x0): given a list of expressions L representing functions in x, outputs #the composition L[1](L[2](....L[n](x0)) EvalC:=proc(L,x,x0): if nops(L)=1 then RETURN(subs(x=x0,L[1])): else subs(x=EvalC([op(2..nops(L),L)],x,x0),L[1]): fi: end: #EvalDC(L,x,x0): given a list of expressions L representing functions in x, outputs #the dreivative of the composition L[1](L[2](....L[n](x0)) at x0 EvalDC:=proc(L,x,x0): if nops(L)=1 then RETURN(subs(x=x0,diff(L[1],x) )): else subs(x=EvalC([op(2..nops(L),L)],x,x0),diff(L[1],x))*EvalDC([op(2..nops(L),L)],x,x0): fi: end: #EvalMC1(n,m,x,x0,F): inputs pos. integer m and n, a symbol x, a numerical (or symbolic) list x0 of length n, and #a list F , of length m of expressions in x[1], ..., x[n] denoting a transformation from n-dim space to m-dim space #outputs the evaluation of x0 in F. Try #EvalMC1(2,3,x,[1,2],[x[1]+x[2],x[1]+2*x[2],x[1]*x[2]]); EvalMC1:=proc(n,m,x,x0,F) local i: if not (type(m,integer) and type(n,integer) and m>0 and n>0 and nops(x0)=n and nops(F)=m) then print(`Bad input`): RETURN(FAIL): fi: subs({seq(x[i]=x0[i],i=1..n)},F): end: #EvalMC(L,x,x0): given a list of expressions L representing functions in x[1],x[2], ..., outputs #the composition L[1](L[2](....L[n](x0)), where x0 is a vector that is compatible EvalMC:=proc(L,x,x0)local i,A: if nops(L)=1 then RETURN(subs({seq(x[i]=x0[i],i=1..nops(x0))},L[1])): #else # A:=EvalMC([op(2..nops(L),L)], fi: end: