Consider the language over the alphabet $\sum= \{a\}$ containing strings whose length is either a multiple of 2 or 3 (including the empty strings). Writing a regular expression for this language
How to write this regular expression
formal languages;regular languages;regular expressions
Hint: A number $n$ is a multiple of $2$ or $3$ if $n \; \mathrm{mod} \; 6 \in \{0,2,3,4\}$.Simpler solution: Take the union of the words whose length is a multiple of 2 with the words whose length is a multiple of 3.