# [Haskell], 32 bytes

<!-- language-all: lang-hs -->

 n!a=[a]==[x|x<-[n..a],mod a x<1]

[Try it online!][TIO-jah7lxzj]

[Haskell]: https://www.haskell.org/
[TIO-jah7lxzj]: https://tio.run/##y0gszk7Nyfn/P08x0TY6MdbWNrqipsJGNzpPTy8xVic3P0UhUaHCxjD2f25iZp5tQVFmXolKSWJ2qoKxoUpaZk5JapGGoZGiZrShnl7sfwA "Haskell – Try It Online"

Ok since its been a while, and the only Haskell answer so far is 45 btyes, I decided to post my own answer.

## Explanation

This function that the only number between **n** and **a** that `a` is divisible by is `a` itself.

Now the definition only mentions **n**-primes smaller than **a**, so why are we checking all these extra numbers? Won't we have problems when **a** is divisible by some **n**-composite larger than **n**?

We won't because if there is an **n**-composite larger than **n** it must be divisible by a smaller **n**-prime by definition. Thus if it divides **a** so must the smaller **n**-prime.

If **a** is smaller than **n** `[n..a]` will be `[]` thus cannot equal `[a]` causing the check to fail.