Different ways of defining primes
Haskell, 45 bytes



n!a=not$any(n!)[x|x&lt;-[n..a-1],mod a x&lt;1]||n&gt;a


Try it online!

I define a nice recursive function (!):

n!a checks if any factor of a, in the range [n,a-1], is an n-prime. Then it negates the result. It also makes sure that n&gt;a