
Trailing zeros of base-B factorial
Given integers \$N\$, \$B\$ in base 10. Count the number of trailing zeros of \$N!\$ when expressed in base \$B\$.
Sample I/O
// N, B -> number of trailing zeros
15, 3 -> 6 // 15! in base 10 = 11122000100002000202000000 in base 3
90, 8 -> 28
150, 17 -> 8
997, 53 -