The number of states in DFA that accepts strings with length that is divisible by $3$ or $5$.

862 Views Asked by At

I know that the answer is $15$ states, but I cannot get my mind to understand why is that? which property makes it impossible to do it in less states? I've tried to mess with it for a long time and still can't find the property that forces me to use $15$ states.
This also seems true for all DFA's of these type, if it accepts strings of length $x$ or $y$, then the number of states it needs is $xy$.

I would really appreciate it if someone could tell me the specific reason of why this happens?