user: This kata generalizes [Twice Linear](https://www.codewars.com/kata/5672682212c8ecf83e000050). You may want to attempt that kata first.

## Sequence

Consider an integer sequence `U(m)` defined as:

1. `m` is a given non-empty set of positive integers.
2. `U(m)[0] = 1`, the first number is always 1.
3. For each `x` in `U(m)`, and each `y` in `m`, `x * y + 1` must also be in `U(m)`.
4. No other numbers are in `U(m)`.
5. `U(m)` is sorted, with no duplicates.

### Sequence Examples

#### `U(2, 3) = [1, 3, 4, 7, 9, 10, 13, 15, 19, 21, 22, 27, ...]`

1 produces 3 and 4, since `1 * 2 + 1 = 3`, and `1 * 3 + 1 = 4`.

3 produces 7 and 10, since `3 * 2 + 1 = 7`, and `3 * 3 + 1 = 10`.

#### `U(5, 7, 8) = [1, 6, 8, 9, 31, 41, 43, 46, 49, 57, 64, 65, 73, 156, 206, ...]`

1 produces 6, 8, and 9.

6 produces 31, 43, and 49.

## Task:

Implement `n_linear` or `nLinear`: given a set of postive integers `m`, and an index `n`, find `U(m)[n]`, the `n`th value in the `U(m)` sequence.

### Tips

* Tests use large n values. Slow algorithms may time-out.
* Tests use large values in the m set. Algorithms which multiply further than neccessary may overflow.
* Linear run time and memory usage is possible.
* How can you build the sequence iteratively, without growing extra data structures?

Answer: {"fn_name": "n_linear", "inputs": [[[2, 3], 0], [[3, 2, 5], 0], [[2, 3], 1], [[2, 3], 2], [[2, 3], 3], [[2, 3], 4], [[2, 3], 5], [[2, 3], 6], [[2, 3], 7], [[2, 3], 8], [[2, 3], 9], [[2, 3], 10], [[2, 3], 11], [[2, 3], 12], [[2, 3], 13], [[2, 3], 14], [[2, 3], 15], [[2, 3], 16], [[2, 3], 17], [[2, 3], 18], [[2, 3], 19], [[2, 3], 20], [[2, 3], 30], [[2, 3], 50], [[2, 3], 97], [[2, 3], 100], [[2, 3], 144], [[2, 3], 200], [[2, 3], 951], [[2, 3], 1000], [[5, 7, 8], 10], [[5, 7, 8], 11], [[2, 3, 4, 5], 33], [[2, 3, 4, 5], 100], [[3, 5, 7, 9, 11], 50], [[3, 5, 7, 9, 11], 70], [[3, 5, 7, 9, 11], 90], [[3, 2], 10], [[3, 2], 234], [[3, 2], 923], [[3, 2], 445], [[1, 3], 999], [[1, 5], 1000], [[5, 12], 519], [[14, 10], 56], [[2, 6], 416], [[10, 13], 741], [[3, 5], 351], [[5, 9], 246], [[8, 13], 864], [[6, 5], 779], [[8, 7], 738], [[12, 2], 752], [[8, 4, 2], 386], [[5, 11, 7], 475], [[3, 8, 5], 190], [[2, 5, 6], 415], [[4, 2, 5], 315], [[4, 8, 7], 354], [[13, 9, 2], 377], [[14, 12, 8], 297], [[12, 14, 2], 181], [[12, 4, 7], 370], [[4, 9, 6, 7, 19, 17, 10, 13], 835], [[10, 5, 9, 17, 6, 12], 71], [[14, 4, 9, 16, 3], 239], [[8, 11, 14, 7, 5, 9, 3, 17], 809], [[11, 15, 19, 5, 14, 12], 210], [[10, 4, 14, 11, 3], 639], [[7, 12, 19, 2, 15, 9, 4], 634], [[9, 19, 7, 12, 16, 18], 273], [[16, 5, 18, 13, 11, 8, 14, 4], 891], [[9, 2, 3, 10, 11, 4, 6, 18], 503], [[2, 3, 6, 17, 13, 5], 570], [[12, 13, 5, 4], 136], [[8, 4, 7, 2, 18, 17], 46], [[13, 12, 19, 3], 784], [[17, 14, 9, 16, 11, 8, 13, 19, 7], 185], [[18, 12, 16, 15, 10, 17, 6, 8, 7], 534], [[3, 18, 10, 9, 19, 6, 7, 17, 4], 195], [[18, 12, 5, 11], 136], [[12, 9, 4, 18, 13, 19], 566], [[12, 2, 6, 5, 4], 243], [[2, 3], 200000], [[2, 3, 5], 300000], [[2, 3, 10000002], 200000], [[2, 3, 5, 10000000], 200000]], "outputs": [[1], [1], [3], [4], [7], [9], [10], [13], [15], [19], [21], [22], [27], [28], [31], [39], [40], [43], [45], [46], [55], [57], [91], [175], [406], [447], [706], [1051], [8013], [8488], [64], [65], [46], [139], [154], [226], [316], [22], [1339], [7537], [2983], [1000], [1001], [32961973], [304795], [37339], [3172655773], [58596], [1553901], [1727528929], [5833116], [80282057], [349957], [1359], [79399], [2346], [2733], [987], [16724], [7127], [246387], [4789], [35965], [3071], [427], [1387], [1941], [3095], [3364], [1156], [6175], [3401], [724], [1006], [1631], [79], [62321], [1090], [2601], [361], [6049], [8949], [527], [7202134], [1092439], [7202134], [719671]]}