# nextprod

nextprod([k_1,k_2,...], n)

Next integer not less than `n` that can be written as \$\prod k_i^{p_i}\$ for integers \$p_1\$, \$p_2\$, etc.

## Examples

The `nextprod` function in Julia returns the next integer not less than `n` that can be written as the product of `k_i` raised to certain powers `p_i`.

``````julia> nextprod([2, 3], 10)
12``````

This example finds the next integer greater than or equal to 10 that can be written as the product of powers of 2 and 3. In this case, the next integer is 12, which is equal to `2^2 * 3^1`.

``````julia> nextprod([2, 3], 20)
24``````

Here, the next integer greater than or equal to 20 that can be expressed as the product of powers of 2 and 3 is 24 (`2^3 * 3^1`).

``````julia> nextprod([2, 3, 5], 100)
120``````

In this example, the next integer not less than 100 that can be represented as the product of powers of 2, 3, and 5 is 120 (`2^3 * 3^1 * 5^1`).

Common mistake example:

``````julia> nextprod([2, 3], -5)
ERROR: ArgumentError: invalid nextprod arguments: -5``````

The `nextprod` function expects a positive value for `n`. If a negative value is provided, it will throw an `ArgumentError`. Ensure that `n` is greater than or equal to zero when using `nextprod`.