The key to problems like these are getting the lhs or rhs (depending on which side n is) to match up to find the value of n
Once u get to 5^21 * 2 ^ 21 = 10^21
Formula : (ab)^n = a^n.b^n (as long as n the exponent is the same
In this problem we just reversed it a^n.b^n = (ab)^n
a=2 b =5