Say we have a number $x$ such that $$ x = a^{r}.b^{s}.c^{t}.p^{u} $$ Is there a formula or method which can directly give me the exponent of a particular prime in this prime factorization.
For small $x$ calculating it is not a problem but when $x$ is of the order of $10^{8}$ finding the exponent of a particular prime becomes tough.
e.g. For $p$ it should give $u$, for $a$ it should give $r$ and so on.
If somehow $x$ can be represented as $\frac{a!}{b!}$ then also it can be done.
Given $x$ and $p$, just divide $x$ by $p$ repeatedly and count how many times it gives no remainder.