I have an alphabet $\sum=\{o,g\}$ and I need to write a regular expression for arbitrary sequences of length $n$ where $n$ is divisible by 2 or 3.
My guess would be [og][og]* | [og][og][og]*, but I am not certain if this is correct or incorrect.
I have an alphabet $\sum=\{o,g\}$ and I need to write a regular expression for arbitrary sequences of length $n$ where $n$ is divisible by 2 or 3.
My guess would be [og][og]* | [og][og][og]*, but I am not certain if this is correct or incorrect.
Your guess is almost correct, but you should change $[og]$ to $\{o,g\}$. You could also write it as $(\Sigma^2)^* \cup (\Sigma^3)^*$.