Is there a multivariate integer function f(x,y) that returns the number of factors of y in x with a closed form? I'm looking for a simple function in terms of the elementary and exponential functions that when passed an integer x and integer y, it returns the number of times that y can be divided from x such that the result is an integer. I believe that it is something along the lines of $\lfloor\log_y(x)\rfloor$, but I am not quite certain. I believe that such a function would be useful for my own interests. No particular usage. I'm just toying around with functions.
 A: I came up with this:
$$f(x,y)=\sum_{n=1}^{\lfloor \log_y x +1 \rfloor } \left\lfloor \frac{\gcd(x,y^n)}{y^n}\right\rfloor .  $$
Not very elementary, I know.  But 
$$\left\lfloor \frac{\gcd(x,y^n)}{y^n}\right\rfloor$$ is $0$ if $y^n$ doesn't divide $x$ and $1$ if it does.  So this sum counts $1$ for each power of $y$ that divides $x$.
A: I can propose the following approach. In order to simplify things suppose that $y\ne 0$. Remark that for integer $z$ and $t\ne 0$ the expression $1+\lfloor  \frac zt\rfloor-\lceil\frac zt\rceil$ equals $1$ if $t$ divides $z$ and equals $0$, otherwise. So we can put
$$f(x,y)=\sum_{i=1}^{\infty}  \left(1+\left \lfloor  \frac {x}{y^i}\right \rfloor-\left\lceil\frac x{y^i}\right \rceil\right)=
\sum_{i=1}^{\lfloor \log_{|y|} |x|\rfloor }  \left(1+\left \lfloor  \frac x{y^i}\right \rfloor-\left\lceil\frac x{y^i}\right \rceil\right).$$
For natural $x$ and prime $y$ a similar expression follows from Legendre's formula, 
$$\sum_{i=1}^{\infty} \left \lfloor  \frac {x}{y^i}\right \rfloor.$$
for the exponent of the largest power of $y$ that divides $x!$. Subtructing from  it the exponent of the largest power of $y$ that divides $(x-1)!$, we obtain 
$$f(x,y)=\sum_{i=1}^{\infty}\left( \left\lfloor  \frac {x}{y^i}\right\rfloor-\left \lfloor  \frac {x-1}{y^i}\right\rfloor\right).$$
