{smcl}
{* 2nov2005}{cmd:help primes}

{hline}

{title:Title}

{p2colset 5 19 21 2}{...}
{p2col :{hi: primes} {hline 2 }}Generating prime numbres{p_end}
{p2colreset}{...}


{title:Syntax}

{p 8 15 2}
{cmd:primes #, clear}


{title:Description}

{pstd}
{opt primes} creates a dataset containing the prime numbers up to the specified
number. Note that {opt clear} is a required option, as {opt primes} destroys the 
dataset currently in memory.

{title:Example}

{phang}{cmd:. primes 20, clear}{p_end}
{phang}{cmd:. list}{p_end}
{txt}
     {c TLC}{hline 7}{c TRC}
     {c |} {res}prime {txt}{c |}
     {c LT}{hline 7}{c RT}
  1. {c |} {res}    2 {txt}{c |}
  2. {c |} {res}    3 {txt}{c |}
  3. {c |} {res}    5 {txt}{c |}
  4. {c |} {res}    7 {txt}{c |}
  5. {c |} {res}   11 {txt}{c |}
     {c LT}{hline 7}{c RT}
  6. {c |} {res}   13 {txt}{c |}
  7. {c |} {res}   17 {txt}{c |}
  8. {c |} {res}   19 {txt}{c |}
     {c BLC}{hline 7}{c BRC}



{title:See also}
{browse "http://mathworld.wolfram.com/PrimeNumber.html":Prime numbers at MathWorld}

{title:Contributed by}
Stas Kolenikov, skolenik at gmail.com
