Minimal DFA accepting strings whose length is divisible by $x$ or $y$
Let $\operatorname{gcd}(x,y) = g$, and suppose that $x,y &gt; g$. If there is a minimal DFA for the language with $n$ states, then according to the pumping lemma, there is $1 \leq m \leq n$ such that the following holds: $\ell \geq n$ is a length of words in the language iff $\ell + m$ is a length of words in the language, that is:

For all $\ell \geq n$: $(x \mid \ell \text{ or } y \mid \ell)$ iff $(x \mid \ell+m \text{ or } y \mid \ell+m)$.

Let $\ell \geq n$ be some multiple of $x$. Then $x \mid \ell$, hence either $x \mid \ell+m$ or $y \mid \ell+m$, which implies that $g \mid \ell$ and $g \mid \ell+m$, and so $g \mid m$.
Suppose that $x \nmid m$. Let $\ell \geq n$ be such that $\ell \equiv -m \pmod{x}$ and $\ell \equiv g \pmod{y}$; there exists such $\ell$ since $g \mid m$. Then $x\nmid \ell$, $y\nmid\ell$ (since $y &gt; g$), but $x\mid \ell+m$, and we reach a contradiction. Therefore $x \mid m$. Similarly, $y \mid m$. Therefore $\operatorname{lcm}(x,y) \mid m$, implying that $n \geq m \geq \operatorname{lcm}(x,y)$ (since $m &gt; 0$).
Conversely, it is easy to construct a DFA for the language with $\operatorname{lcm}(x,y)$ states, showing that this is the number of states in a minimal DFA, assuming that $x,y &gt; g$.
If $x = g$ or $y = g$, then the language consists of all words whose lengths are a multiple of $g = \min(x,y)$, and so the minimal DFA contains $\min(x,y)$ states.
Finally, if we replace or with and in the definition, then we get the language of all words whose lengths are a multiple of $\operatorname{lcm}(x,y)$, whose minimal DFA contains $\operatorname{lcm}(x,y)$ states.