Can someone confirm whether this is true :
$((a^b \ mod\ n) * (a^c \ mod \ n)) \mod \ n = a^{b+c} \ mod \ n$
Im pretty sure it is, and every combination of numbers i try manually works, but when i try to write a program that tests this for combinations from 1 to 25 for a,b,c,n i get different results and im not sure whether this is to problems with the modulus operation, maybe overflows happening
I cant find any rules for this specifically since the equation is so long
Let $a^b = dn + e$, where $0 \le e \lt n$ and $a^c = fn + g$, where $0 \le g \lt n$. Then your left side is
$$((a^b \ \text{mod} \ n) * (a^c \ \text{mod} \ n)) \ \text{mod} \ n = eg \ \text{mod} \ n \tag{1}\label{eq1}$$
Since $a^{b+c} = (a^b)(a^c) = (dn + e)(fn + g) = dfn^2 + (dg + ef)n + eg$, your right side is
$$a^{b+c} \ \text{mod} \ n = eg \ \text{mod} \ n \tag{2}\label{eq2}$$
Thus, your LHS and RHS match.