Is the language { | p and n are natural numbers and there's no prime number in [p,p+n]} belongs to NP class? I was wondering if the following language belongs to NP class and if its complimentary belongs to NP class:

\begin{align}
C=\left\{\langle p,n\rangle\mid\right.&amp;\ \left.  p \text{ and $n$ are natural numbers}\right.\\
&amp;\left.\text{ and there's no prime number in the range}\left[p,p+n\right]\right\}
\end{align}

could you please check if my reasoning is okay to deduce NP?
(I am not sure, but here's what I think):
for each word $\langle p,n\rangle \in C$ we know that the word belongs to C because there exists a primal certificate -  an nontrivial divisor to any of the numbers between $[p,p+n]$, though I am not really sure it is in NP.

regarding the complement: I think it is in NP because the compliment compositeness can be decided by guessing a factor nondeterministically. But again I am not so sure about it and I don't know how to correctly prove and show it.

Would really appreciate your input on that as I am quite unsure and also checked textbooks and internet (and this site) about it.

Edit: for the sake of solving the problem, due to xskxzr's comment, let's assume p and n are represented by binary, as there's a difference according to his comment between p and n being represented in unary and binary(this is also quite interesting).
Note that there's always a prime between $p$ and $2p$ for any $p$ thus we can eliminate $n$ as a complexity parameter, as for any non-trivial  instance we have $n &lt; p$.

The complement (there exists a prime in range $[p, p+n]$) is quite easy  (due to the shoulders of giants). There are various well-known polynomial size certificates of primality of $q$ you could return along with some $q \in [p, p+n]$ if that prime $q$ exists. Thus your language is in co-NP.

However the question of whether it is in NP or not seems very hard to me. Our input size is $b$ such that $2^b \approx p$. You need the existence of a $O(b^c)$ sized certificate that in the worst case asserts the compositeness of an exponentially large ($|[p, p+n]| \approx |[p, 2p]| \approx p \approx 2^b$) series of consecutive integers. From my intuition about number theory, finding such a certificate would be a major result, but disproving its existence would be as well. But perhaps someone with more number theoretic knowledge than me can pitch in if either of those turn out to be easy.