Is L2 = {a^n| n is a product of one or more primes} regular?
According to the Fundamental Theorem of Arithmetic, any integer $&gt;1$ can be written as a product of one or more primes (in a unique way).  So, it seems that your language can be simplified as $\{a^n\mid n\geq 2\}$.