Can someone explain this conclusion for Finite State Machines? PS It isn't a homework problem..
(But the results seems to be working for me when I checked manually a couple of values of m and n)

Let's say I have two FSM's(calling them A and B)


A is the the machine for checking divisibility by any +ve number (calling it m)
B is the the machine for checking divisibility by any +ve number (calling it n)
(m and n aren't equal)


Now we have a third machine (C) for which we need to find the number of states it will have if the goal of that machine is A machine(FSM) which will accept Divisibility of both $n$ and $m$)

So here are the claims for the count of states for $C$,


if $GCD (m,n)$ equivalent to $1$, then the number of states in C is $m*n$
if $GCD (m,n)$ isn't equivalent to $1$, then number of states in C is $LCM(m,n)$


(EDIT 1- Both are technically the  same thing, check the comments and the answer)

(Edit -2  I meant this, if we have strings given to us over {0,1}, and the machines will then calculate the divisibility by the given number and with result in either of the (let's say the number we are dividing with is n) n-1 states as we can have n-1 modulo values possible)

I have checked the results for few m and m manually and they seem to be correct for them..

But why it's so?(I know that A and B will have m and n as count of states respectively for minimal DFA)
In both cases, the number of states is the LCM. This is because a number is divisible by $m$ and&nbsp;$n$ if, and only if, it is divisible by $\mathrm{lcm}(m,n)$ and, for any positive integer&nbsp;$d$, you can check that the input length is divisible by&nbsp;$d$ by having states $\{0, \dots, d-1\}$ such that the automaton is in state&nbsp;$i$ when the number of characters read is congruent to&nbsp;$i$, modulo&nbsp;$d$.