Prove non regularity of the language a^n where n is an even or a prime number, with the pumping lemma

259 Views Asked by At

How to prove that the language that is the union of the language where $n$ is an even number and the language where $n$ is a prime number is non-regular with the pumping lemma?

I know how to prove that the language $a^n$ where $n$ is a prime number is non-regular, but I'm struggling to prove the union.

Can anyone help me, please?

Thank you.