We know that for an arbitrarily large $N \in \mathbb{N}$ we can have $N$ consecutive natural numbers of which none is prime. A construction that verifies this is the set $B(n)=\{n!+2, n!+3,\cdots,n!+n\}$ since the first term is divisible by $2$, the second by $3$ and so on. So we have gaps between primes which are as large as we want them to be.
I was wondering-as part of a cryptography application I was working on-whether
For a given $M\in \mathbb{N}$ can we choose an $N$ such that $N$ consecutive natural numbers are not primes but there exists a set of $N$ consecutive natural numbers of which $M$ are prime?
Or, for $S_N=\{s+1,s+2,\cdots,s+N\}$ such that no $s+i, i\in\{1,2,\cdots,N\}$ is prime can we have $A_n=\{a+1,a+2,\cdots,a+N\}$ such that $A_N\supset Q=\{a+j_1,a+j_2,\cdots,a+j_M\}$ is a set of $M$ primes?
The two sets can differ in terms of how large the numbers are and no other similarities except of their cardinality are required.
I think it is obvious that $M\lt\lt N$ given the "scarcity" of primes the larger the $N$ is.
This is actually an open problem, but conjecturally it is fairly well-understood. See my answer here to a related question: the relationship between the two problems is in fact surprisingly close!
As Ross Millikan has pointed out, obviously it is possible for $M$ to be as large as $\pi(N)$, but in fact Hensley and Richards showed there are admissible tuples which are even denser, about $\pi(N) + c N/(\log N)^2$ in size for some $c>0$. It appears to be an open problem (as of 1985) whether $c$ can be arbitrarily large.
One catch is that just because we have an admissible tuple, doesn't mean we have the computational resources to find an actual suite of primes corresponding to those offsets. The prime $k$-tuples conjecture predicts that there are infinitely many examples, but at this scale (thousands of primes!) they are expected to be so exceedingly rare that it would take an enormously long time to find a concrete example.