Q1: Make L into a set LS. LS := {op(L)}; Then find the intersection of the 2 sets. LS intersect S. Q2. First define a function that leaves multiples of 3 as is and replaces every other number by -100. mof3:= n->piecewise(irem(n,3)=0,n,irem(n,3)<>0,-100); Then run it on the list L LL:=map(mof3,L); Then make it into a set S:={op(LL)}; Then extract the -100 out -- SS:=S minus {-100} Finally return the number of elements of SS nops(SS); Q3. newseq :=proc(n::integer) return {seq(-i,i=1..n)}; end proc;