# primes

primes([lo,] hi)

Returns a collection of the prime numbers (from `lo`, if specified) up to `hi`.

## Examples

1. Generate prime numbers up to a given limit:

``````julia> primes(20)
8-element Array{Int64,1}:
2
3
5
7
11
13
17
19``````

The `primes` function returns an array of prime numbers up to the specified limit (inclusive). In this example, prime numbers up to 20 are generated.

2. Generate prime numbers within a specific range:

``````julia> primes(10, 30)
6-element Array{Int64,1}:
11
13
17
19
23
29``````

By providing both the lower limit (`lo`) and the upper limit (`hi`), the `primes` function generates prime numbers within the specified range.

3. Handle cases with no prime numbers in the range:
``````julia> primes(30, 40)
0-element Array{Int64,1}``````

When there are no prime numbers within the specified range, an empty array is returned.

Common mistake example:

``````julia> primes(-5)
ERROR: ArgumentError: `lo` must be a non-negative integer``````

In this example, a negative value is provided for the `lo` argument. The `lo` argument must be a non-negative integer. Make sure to provide valid inputs to the `primes` function.