Has anyone encountered the following function $u_k: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$? I'm searching for information and terminology for the function $u_k(n) = \sum_{i=1}^n w_k(i)$, where $w_k(i)$ is the highest power of $k$ that divides $i!$.  I think the function $w_k(n)$ can be called the Legendre formula. 
 A: We can make a statement about the asymptotics of this sum. Let us first change notation slightly so as not to give the impression that the summation index is somehow a complex number. Put
$$u_k(n) = \sum_{q=1}^n w_k(q).$$
Then by a direct count of the contributions involved we find that
$$u_k(n) = \sum_{q=1}^n \sum_{p=1}^q v_k(p)$$
where $v_k(p)$ is the exponent of the highest power of $k$ that divides $p.$
Re-write this as follows:
$$u_k(n) = w_k(n) + \sum_{q=1}^{n-1} \sum_{p=1}^q v_k(p).$$
Now before continuing note that we have the following bound where $k$ is prime 
$$w_k(n) =  \sum_{p=1}^n v_k(p)
= \sum_{m=1}^{\lfloor \log_k n \rfloor} \lfloor n/k^m \rfloor
\le n \sum_{m=1}^{\lfloor \log_k n \rfloor} 1/k^m
= \frac{n}{k} \frac{1-1/k^{\lfloor \log_k n \rfloor}}{1-1/k}
\\= \frac{n}{k-1} (1-1/k^{\lfloor \log_k n \rfloor}).$$
We also get the lower bound
$$w_k(n) =  \sum_{p=1}^n v_k(p)
= \sum_{m=1}^{\lfloor \log_k n \rfloor} \lfloor n/k^m \rfloor
\ge \sum_{m=1}^{\lfloor \log_k n \rfloor} (n/k^m-1)
\\ = \frac{n}{k-1} (1-1/k^{\lfloor \log_k n \rfloor})- \lfloor \log_k n \rfloor.$$
Joining these two bounds we have that for $k$ prime
$$w_k(n) \sim \frac{n}{k-1}$$
and $$u_k(n) \sim \frac{1}{k-1} \sum_{q=1}^n q
= \frac{1}{2} \frac{1}{k-1} n (n+1).$$
Now a little thought shows that when $k$ is not prime the largest prime factor of $k$, call it $m$ to the power $r$ so that $r$ is the max such that $m^r|k$, dominates asymptotically and we have
$$u_k(n) \sim \frac{1}{2} \frac{1}{m-1} \frac{1}{r} n (n+1).$$
Next we apply the Mellin-Perron summation formula to confirm these asymptotics. Let $k$ be prime. Then we have
$$u_k(n) = w_k(n) + \frac{n}{2\pi i}
\int_{c-i\infty}^{c+i\infty} L_k(s) n^s \frac{ds}{s(s+1)}$$
where $$L_k(s) = \sum_{q\ge 1} \frac{v_k(q)}{q^s}.$$
We need to find a closed form for $L_k(s)$ which we obtain from the following Euler product:
$$L_k(s) = \prod_p \frac{1}{1-1/p^s} \times (1-1/k^s)
\times \sum_{q\ge 0} \frac{q}{k^{qs}}$$
which simplifies to
$$L_k(s) = \zeta(s) \times (1-1/k^s) \times \frac{1/k^s}{(1-1/k^s)^2}
= \zeta(s) \frac{1/k^s}{1-1/k^s} = \zeta(s) \frac{1}{k^s-1}.$$
We need to examine the poles of the integrand in order to evaluate the Mellin-Perron integral. There is a simple pole at $s=1$ from the zeta function, a double pole at $s=0$, another simple pole at $s=-1$ and simple poles at $\frac{2\pi i q}{\log k}$ with $q$ a non-zero integer. We will apply the Wiener-Ikehara theorem however which is applicable here and therefore we only need the contribution from $s=1$ which is
$$n\times \frac{1}{k-1} \times n \times \frac{1}{1\times 2}
= \frac{1}{2} \frac{1}{k-1} n^2.$$
And indeed Mellin-Perron has confirmed the asymptotics that we calculated by elementary means earlier.
