By the pumping lemma, there then exist strings \(u,v\) and \(w\) in \({I^*}\) such that \(x = uvw,L(uv) \le |S|\) and \(l(v) \ge 1\) and \(u{v^i}w \in L{\rm{(}}M{\rm{)}}\) for \(i = 0,1,2, \ldots \)
Let \(v\) consist of \(m\) ones with \(m\) a positive integer, thus \(v = {1^m}\).
However, then \(M\) also generates \({1^{{p_k} + pm}}\) for all positive integers \(p\) (as \(u{v^i}w \in L{\rm{(}}M{\rm{)}}\)). This then implies that \({p_K} + p{\bf{ }}m\) is a prime for all positive integers \(p\).
This is impossible, because the difference between successive primes increases more and more (as there are \(n - 1\) nonprimes from \(n{\bf{ }}! + 2\) and \(n{\bf{ }}! + n\)), while the difference between successive terms \({p_K} + p{\bf{ }}m\) increases consistently by \(m\), and thus at some point one of the elements \({p_K} + p{\bf{ }}m\) is not a prime. Thus, you have derived a contradiction.
It implies that the assumption which is " \(P\) is regular" is incorrect.
Hence, \(P\) is not regular.