What is the Max value of n when 185! is divided by (189^n) will give an Integer Value? 
What is the Max value of n when $185!$ is divided by $(189^n)$ will give an Integer Value?

Options are
a) $91$ 
b) $30$ 
c) $36$
d) $24$
MyApproach:
$189$=$3^3$ . $7$
When $185$/$3$=$61$
$61$/$3$=$20$
$20$/$3$=$6$
$6$/$3$=$2$
Its Remainder Sum=$89$
$185$/$7$=$26$
$26$/$7$=$3$
Its Remainder Sum=$29$
So,3^89 . $7$^$29$
$27$^$29$ . $7$^$29$
I am getting $29$ as the final Ans.
Required Ans is 30
Why i am getting the Ans wrong?
Also,
Is there any better approach i can solve this problem.
 A: Well,
Prelude> let m = product [1 .. 185] :: Integer
Prelude> m `mod` (189^29)
0
Prelude> m `mod` (189^30)
37470960172551150153411831285317353601062526805310229978097429296724

it's not you who is wrong. Your result is correct, the required answer is incorrect.

Is there any better approach I can solve this problem?

Not really, counting the (relevant) prime powers dividing the factorial is the best method generally.
A: Your answer is right. Here is how I do it:
As $189=3^3\cdot 7$, $\;185!$ is divisible by $189^n=3^{3n}\cdot7^n$ if and only if
$$v_3(185!)\ge 3n\enspace\text{and}\enspace v_7(185!)\ge n$$
(for a prime number $p$, $v_p(n)$ denotes the $p$-adic valuation of $p$ in $n$, i.e. the exponent of $p$ in the decomposition of $n$ into its prime factors)
We can use Legendre's formula to find the valuations of a factorial:
$$v_p(n!)=\biggl\lfloor\frac np\biggr\rfloor+\biggl\lfloor\frac n{p^2}\biggr\rfloor+\biggl\lfloor\frac n{p^3}\biggr\rfloor+\dotsm$$
(this sum is actually finite). In the present case we obtain:
$$v_3(185)=61+20+6+2=89,\quad v_7(185)=26+3=29,$$
hence we must have $\;3n\le 89$ and $n\le 29$. The greatest $n$ that satisfies both conditions is indeed $29$.
A: The problem can be analize of a different approach. If we analize $185!$ taking advantage that $7$ is prime, we see that
$$
185!=n(7*14*21*28*35*42*49*56*63*70*77*84*\ldots*175*182). 
$$
The number of factors that contains $7$ are $[185/7]=26$. But, there others factors that altes our result such that
$$
49,98,147.
$$
In summary, there existe $m\in\mathbb{Z}$ co-prime with $7$ such that
$$
185!=m*7^{26+1+1+1}=7^{29}m.
$$ 
If $189^n$ divides $185!$ is neccesary that $7^n$ divides $185!$. For our last result $n\leq 29$. So if $189^n$ divides $185!$, then $n\leq 29$. 
If we analize for $3$ we have:
$[185/3]=61$.
$[185/9]=20$.
$[185/27]=6$.
So, we have that $185!=3^{61+20+6}r=3^{87}r=27^{29}r$. With $r$ does not contain $3$. For all of this we have
$$
185!=27^{29}7^{29}k=189^{29}k,
$$
where $k$ doesn't contain $189$. This means that the max $n$ such that $189^n$ divides $185!$ is 29.
The options are wrong.
