What is the multiplicative order of a product of two integers $\mod n$?

This is a rather long answer, so feel free to skip over to the formula. $\def\ord{\text{ord}}\def\div{\text{ divides }}\def\v#1#2{v_{#1}(#2)}$


Let $G$ be an abelian group with two elements $a,b$. Suppose $a$ has order $m$ and $b$ has order $n$. Denote $l=\text{lcm}(m,n)$ and $g=\text{gcd}(m,n)$. Also define $H=\langle a\rangle,K=\langle b\rangle$ and $s=|H\cap K|$.

Our goal is to determine the order of $ab$.

Since $H\cap K$ is a subgroup of $H$ and $H$ is cyclic, we know $H\cap K$ must be generated by $a^{m/s}$. Similarly $H\cap K$ is generated by $b^{n/s}$. Hence there is some $k_0$ which is relatively prime to $s$ such that $a^{m/s}=b^{nk_0/s}$.


Lemma. $$\frac ls\div\ord(ab)\div l.$$

Proof.

Let $x=\ord(ab)$. Since $(ab)^x=e$, we see $a^x\in H\cap K=\langle a^{m/s}\rangle$, so $m/s\mid x$, i.e. $m\mid xs$. Similarly, $n\mid xs$. Hence $l\mid xs$, namely, $l/s\mid\ord(ab)$.

Also, $(ab)^l=e$, so $\ord(ab)\mid l$.


Theorem. $$\ord(ab)=\frac l{\gcd(s,\frac{m+nk_0}g)}.$$

Proof.

From the above lemma we know $\ord(ab)=lk/s$ for some $k$.

Now we consider $(ab)^{lk/s}=e$. $$ \eqalign{ (ab)^{lk/s}&=(a^{m/s})^{lk/m}b^{lk/s}\cr &=(b^{nk_0/s})^{lk/m}b^{lk/s}\cr &=b^{lk/s(1+nk_0/m)}\cr &=b^{lk(m+nk_0)/ms} } $$ So $(ab)^{lk/s}=e$ is equivalent with $n\mid lk(m+nk_0)/ms$, i.e. $mns\mid lk(m+nk_0)$.

Note that $mns=lgs$, so it is further equivalent with $s$ dividing $k(m+nk_0)/g$.

Let $g_1=\gcd(s,\frac{m+nk_0}g)$. Then it is equivalent with $s/g_1$ dividing $k\frac{m+nk_0}{g}/g_1$. But we know $s/g_1$ and $\frac{m+nk_0}{g}/g_1$ are relatively prime, so this is equivalent with $s/g_1$ dividing $k$, that is to say, the least such $k$ is $s/g_1$.

Therefore $\ord(ab)=lk/s=\frac{l(s/g_1)}s=\frac l{g_1}$ as desired.


From this formula we can derive a necessary and sufficient condition for $\ord(ab)=l$: $\gcd(s,\frac{m+nk_0}g)=1$. A non-trivial special case is when, for every prime divisor $p$ of $s$, $p$ does not divide $\frac{m+nk_0}g$, e.g. when $p$ divides $m$ and $n$ to different degrees.


Hope this helps.


Note the extreme case $b \equiv 1/a \mod n$, where $\text{ord}_n(a) = \text{ord}_n(b)$ but $\text{ord}_n(ab) = 1$.

What is true is that $\text{ord}_n(ab) \mid \text{lcm}(\text{ord}_n(a), \text{ord}_n(b))$, since if $\text{ord}_n(a) | m$ and $\text{ord}_n(b) | m$ then $(ab)^n = a^n b^n \equiv 1 \mod n$.

Moreover, using $a = b^{-1} (ab)$ we get $\text{ord}_n(a) \mid \text{lcm}(\text{ord}_n(b), \text{ord}_n(ab))$, and similarly $\text{ord}_n(b) \mid \text{lcm}(\text{ord}_n(a), \text{ord}_n(ab))$. Thus if for some prime $p$ and positive integer $k$, $p^k$ divides $\text{ord}_n(a)$ but not $\text{ord}_n(b)$, we must have $p^k | \text{ord}_n(ab)$.