This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / Built-in Functions / Numerical Computation / Data Manipulation /

Further Examples: Complement

This gives all those elements of the first list that do not appear in either of the other two lists.

In[1]:=

Out[1]=

Complement also works with heads other than List.

In[2]:=

Out[2]=

This defines a version of Complement that neither sorts nor removes duplicates.

In[3]:=

In[4]:=

Out[4]=

In[5]:=

Out[5]=

RelativePrimes gives the list of primes less than n and relatively prime to n.

In[6]:=

In[7]:=

Out[7]=