chickadee » math » max-dividing-power

max-dividing-power a bprocedure
a
integer
b
integre

Returns the largest exponent, n, of a power with base a that divides b.

That is, (expt a n) divides b but (expt a (+ n 1)) does not divide b.

> (max-dividing-power 3 (expt 3 4))
4
> (max-dividing-power 3 5)
0