IntegerExponent
IntegerExponent[n, b] gives the highest power of b that divides n.
Examples
Power of 2 in 24:
IntegerExponent[24, 2]
(* 3 *)Power of 5 in 1000:
IntegerExponent[1000, 5]
(* 3 *)Please visit the official Wolfram Language Reference for more details.