I'm looking for the function that for a number n returns the number of times a number k is a factor of n. So for example for k=3, the following values are returned for a n of 1 through 27:
$$\begin{array}{c:c} n & \text{# of times $k=3$ is a factor of $n$}\\ \hline 27 & 3 \\ 9, 18 & 2 \\ 3, 6, 12, 15, 21, 24 & 1 \\ \text{the rest} & 0 \end{array}$$
What is the name of that function and how is it written? I hope this is an easy question, my google-fu has failed me.
Edit: after I refined my title a bit a relevant question came up in the suggestions. (Notation for the number of times one element divides another.) However I couldn't read the answer so go easy on me. I'm just using real, positive integers today.
To rephrase, you are asking for the highest power of a (prime) number $p$ which divides a given number $n$. This is called the p-adic order of the number, and usually denoted either $\nu_p(n)$ or $\operatorname{ord}_p(n)$.