) v0 \) Z$ ?# s' B2 B6 Q+ q. m" ^2 x$ W> op(s);/ F2 w) l9 A( |- o* T
Error, wrong number (or type) of parameters in function op # E/ A/ ~/ C e! P7 \: W+ E! L3 [> nops(s); 4 O8 V ^9 ^3 Z" IError, wrong number (or type) of parameters in function nops0 M8 C' D, t G. m* y$ n
> op([s]); . D+ R# K. |0 x1 h 3 n) R/ m& m0 t2 e% @' E
> nops([stuff]);. m* O: U! B( a1 Y
9 T( S5 D' |7 y1 Z. @; D函数seq是最有用的生成序列的命令, 通常用于写出具有一定规律的序列的通项, 命令格式为: " p& i0 G+ g; ~8 I. lseq(f(i), i=m..n); # 生成序列f(m), f(m+1), …, f(n) (m,n为任意有理数)+ s; B8 ^8 p: w$ R1 A X
seq(f(i), i=expr); # 生成一个f映射expr操作数的序列/ P# K5 `' a+ V7 ^: }
seq(f(op(i,expr)), i=1..nops(expr)); # 生成nops(expr)个元素组成的序列 # d+ ?( s1 ]: V* s$ B3 ~: O> seq(i^2,i=1..10);% l. a3 g; e g* I. X
# l: P6 O$ g3 |+ ]; I# s
> seq(ithprime(i),i=1..20); 7 b( `$ _$ V) a, \/ J / {8 ^! z8 ~+ I. k* k9 ?
> seq(i^3,i=x+y+z); 3 U1 [# Z* w4 r7 K) @9 L- ] $ C' C+ u7 s7 j# l0 \3 k: U> seq(D(f),f=[sin,cos,tan,cot]);) t6 I. Y2 o1 o. x' B- E a