Primjer 1: Ispiši prvih 20 prostih brojeva.

In[15]:=

f[n_] := Table[Prime[i], {i, 1, n}]

In[16]:=

f[20]

Out[16]=

{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71}


Created by Mathematica  (February 23, 2006)