What is the name for the function that returns the number of times one number is a factor of another

118 Views Asked by At

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.

2

There are 2 best solutions below

2
On

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)$.

0
On

From Ireland and Rosen, "A classical introduction to modern number theory," (page 3):

Let $n\in\mathbb{Z}$ and let $p$ be prime. Then if $n$ is not zero, there is a nonnegative integer $a$ such that $p^a\mid n$ but $p^{a+1}\not\mid n$. [...] The number $a$ is called the order of $n$ at $p$ and is denoted by $\operatorname{ord}_p n$. Roughly speaking, $\operatorname{ord}_pn$ is the number of times $p$ divides $n$. If $n=0$, we set $\operatorname{ord}_pn=\infty$. Notice that $\operatorname{ord}_pn=0$ if and only if (iff) $p\not\mid n$.

The omitted part was about how this is well defined for positive and negative $n$.

The language "order of $n$ at $p$" evokes a modern idea that $n$ is a function that can be evaluated at different primes (by modulo), and $\operatorname{ord}_pn$ is the order of the zero at $p$. It's like how the polynomial $(x-1)^2$ has an order-$2$ zero at $1$.