I'd like to put this in a comment, but since I cannot yet do that (low rep), I will write this as an answer:
a- and an- are used in words with Greek origin, (meaning no, absence of, without, lack of, not on said language). Other greek prefixes are ana-, (meaning again, up, on, above, c.f. anabaptist literally meaning "re-baptist") and anti- (meaning against, c.f. antidemocrat).
Anyway, the thing is that as language is a living thing with lots and lots of users (especially in the case of English, where there also are a lot of different cultures, further contributing to the confusion), and therefore, rules like this tend to be mixed up (especially when creating new words or combining already existing). The rule of thumb is that, as previously stated:
un- is used in words with German origin,
in- in words with Latin origin (and generally in words from other Latin derived languages, like Spanish or French),
- a- and an- is used in words with Greek origin.
Prefixes like de-, dis- and dys- come from Latin and have slight a different meaning.
Note that most of these have the same origin, but they have taken very different ways in to our language of today.