Prime containment numbers (golf edition) This is sequence A054261.

The \$n\$th prime containment number is the lowest number which contains the first \$n\$ prime numbers as substrings. For example, the number \$235\$ is the lowest number which contains the first 3 primes as substrings, making it the 3rd prime containment number. 

It is trivial to figure out that the first four prime containment numbers are \$2\$, \$23\$, \$235\$ and \$2357\$, but then it gets more interesting. Since the next prime is 11, the next prime containment number is not \$235711\$, but it is \$112357\$ since it's defined as the smallest number with the property.

However, the real challenge comes when you go beyond 11. The next prime containment number is \$113257\$. Note that in this number, the substrings 11 and  13 are overlapping. The number 3 is also overlapping with the number 13. 

It is easy to prove that this sequence is increasing, since the next number needs to fulfill all criteria of the number before it, and have one more substring. However, the sequence is not strictly increasing, as is shown by the results for n=10 and n=11.

Input

A single integer n&gt;0 (I suppose you could also have it 0-indexed, then making n&gt;=0)

Output

Either the nth prime containment number, or a list containing the first n prime containment numbers.

The numbers I have found so far are:

 1 =&gt;             2
 2 =&gt;            23
 3 =&gt;           235
 4 =&gt;          2357
 5 =&gt;        112357
 6 =&gt;        113257
 7 =&gt;       1131725
 8 =&gt;     113171925
 9 =&gt;    1131719235
10 =&gt;  113171923295
11 =&gt;  113171923295
12 =&gt; 1131719237295


Note that n = 10 and n = 11 are the same number, since \$113171923295\$ is the lowest number which contains all numbers \$[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\$, but it also contains \$31\$.

Since this is marked code golf, get golfing! Brute force solutions are allowed, but your code has to work for any input in theory (meaning that you can't just concatenate the first n primes). Happy golfing!
05AB1E, 8 bytes

∞.ΔIÅpåP


Try it online!

Explanation

           # from
∞          # a list of infinite positive integers
 .Δ        # find the first which satisfies the condition:
       P   # all
   IÅp     # of the first &lt;input&gt; prime numbers
      å    # are contained in the number