3

I've seen a few other threads on here, namely this and this, which mention and discuss the Divisor Summatory Function $D(x)=\sum_{n=1}^x\sigma_0(n)$ for parameters other than $x$. But neither quite fit what I'm looking for: in the first link (and the wikipedia page for $D(x)$), it is noted that $$D(x)=\sum_{k=1}^x\bigg\lfloor\frac{x}{k}\bigg\rfloor=2\sum_{k=1}^u\bigg\lfloor\frac{x}{k}\bigg\rfloor-u^2, u=\lfloor\sqrt x\rfloor$$ Which can compute $D(x)$ in $\mathcal{O}(\sqrt x)$ time. Now suppose I define $D'(x) = \sum_{n=1}^x\sigma_0(kn)$ for some integer $k$. I need to compute this for different values of $k$ in far faster than $\mathcal{O}(x)$ time, but I don't think that formula applies any longer and I can't seem to find or derive anything similar. Any ideas?

EDIT 1: At this rate, I've started moving on from that above expression in favor of fiddling around with the prime powers. If $k$ and $n$ are relatively prime, then clearly $\sigma_0(kn)=\sigma_0(k)\sigma_0(n)$. Suppose $n=p_1^{a_1}p_2^{a_2}...p_n^{a_n}$. I've noticed that if $k=p_i$ is prime, \begin{equation} \begin{split} \sigma_0(kn) & = (a_1+1)(a_2+1)...((a_i+1)+1)...(a_n+1) \\ & = (a_1+1)...(a_{i-1}+1)(a_{i+1}+1)...(a_n+1)+\sigma_0(n) \\ & = \frac{\sigma_0(n)}{p_i^{a_i}}+\sigma_0(n) \\ & = \frac{p_i^{a_i}+1}{p_i^{a_i}}\sigma_0(n) \end{split} \end{equation}

Similarly, if $k=p_i^q$ is a prime power then $\sigma_0(kn)=(p_i^{a_i}+q)p_i^{-a_i}\sigma_0(n)$. The only case I have not put in some terms of $\sigma_0(n)$ are composite factors of $x$, which for $x$ which aren't absolutely enormous are computable in negligible time. All that's needed now is to somehow simplify to lower the number of terms necessary, probably by combining certain cases when $k$ relatively prime to $x$ and/or a prime power somehow. It is here I once again hit a wall.

Vedvart1
  • 991
  • Why would you need it, and for what $k$ ? (do you need it for every $k \le x/K$ ? Is $K$ small ?) – reuns Jul 11 '17 at 01:36
  • If you need it for every $k$, then compute $\sigma_0(n)$ for $n \le x$ – reuns Jul 11 '17 at 01:40
  • I need it for any $k$ really, just curious about an arbitrary $k$. But I do need it for $x$ as large as $10^{12}$, which makes a brute up to $x$ both impractical and unsatisfying. – Vedvart1 Jul 11 '17 at 01:43
  • Computing $\sigma_0(n)$ for $n \le x$ takes $x \log x$ operations, this is satisfying when you need the value for every $n \le x$. – reuns Jul 11 '17 at 01:44
  • Also why do you need it, really ? – reuns Jul 11 '17 at 01:46
  • See my answer, also the formula you use for $D(x)$ is incorrect in stating that $D(x)=2\sum_{n\leq \sqrt x} \lfloor \frac xn \rfloor -x$. It has to be $D(x)=2\sum_{n\leq \sqrt x} \lfloor \frac xn \rfloor - \lfloor \sqrt x \rfloor ^2$. Check again the wiki link you cited. – Sungjin Kim Jul 11 '17 at 02:38

1 Answers1

0

Let us use $\tau(n):=\sigma_0(n)$. For given $k$, the function $n\mapsto \tau(kn)$ is not multiplicative in general. But, if it is possible to write down Dirichlet series of this function, then it will give us a useful formula for $\sum_{n\leq x} \tau(kn)$. i.e. We aim for finding $F(s)$ in the expression: $$ \sum_{n=1}^{\infty} \frac{\tau(kn)}{n^s} = F(s) \zeta(s)^2. \ \ \ (1) $$

A similar treatment has been done with the Dirichlet series $\sum_{n=1}^{\infty}\frac1{\tau(kn)n^s}$ in II.6, page 209 in Tenenbaum's Introduction to Analytic and Probabilistic Number Theory. A link to Google books is here.

For any prime $p$ and an integer $n$, denote by $\nu_p(n)$ the maximal nonnegative integer $a$ with $p^a |n$. (In such case, we write $p^a ||n$. ) Then $$ \tau(kn)=\prod_p (\nu_p(k)+\nu_p(n)+1) $$ where the product runs over all primes. Then we have $$\begin{align} \sum_{n=1}^{\infty} \frac{\tau(kn)}{n^s}&= \prod_p \left( \sum_{v=0}^{\infty} \frac{\nu_p(k)+v+1}{p^{vs}}\right)\\ &=\prod_{p^a||k }\left(\sum_{v=0}^{\infty}\frac{a+v+1}{p^{vs}}\right)\prod_{p\nmid k}\left(\sum_{v=0}^{\infty} \frac{v+1}{p^{vs}}\right)\\ &=\prod_{p^a||k }\left(\sum_{v=0}^{\infty}\frac{a+v+1}{p^{vs}}\right)\left(\sum_{v=0}^{\infty} \frac{v+1}{p^{vs}}\right)^{-1}\left(\sum_{v=0}^{\infty} \frac{v+1}{p^{vs}}\right) \prod_{p\nmid k}\left(\sum_{v=0}^{\infty} \frac{v+1}{p^{vs}}\right)\\ &=\prod_{p^a||k} \left(\sum_{v=0}^{\infty} \frac{a+v+1}{p^{vs}}\right)\left(\sum_{v=0}^{\infty} \frac{v+1}{p^{vs}}\right)^{-1} \zeta(s)^2\\ &=\prod_{p^a||k} \left(\left( 1-\frac1{p^s}\right)^{-2} +a \left(1-\frac1{p^s}\right)^{-1}\right) \left(1-\frac1{p^s}\right)^2 \zeta(s)^2\\ &=\prod_{p^a||k} \left(1+a\left(1-\frac1{p^s}\right)\right) \zeta(s)^2\\ &=\prod_{p^a||k}\left(1+a -\frac a{p^s}\right) \zeta(s)^2 \end{align} $$ We write $$F(s): = \prod_{p^a||k}\left(1+a -\frac a{p^s}\right):=\sum_{n=1}^{\infty} \frac{f(n)}{n^s}.$$ This is a Dirichlet series with finite number of terms, and we achieved (1).

The formula (1) yields the convolution expression $$ \tau(kn)=\sum_{d|n} f(d)\tau\left(\frac nd\right). $$ Now, we write the summatory function for $\tau(kn)$ as follows: $$ \begin{align} \sum_{n\leq x}\tau(kn) &= \sum_{n\leq x }\sum_{d|n} f(d)\tau\left(\frac nd \right)\\ &=\sum_{d\leq x} f(d) \sum_{m\leq \frac xd} \tau(m) \\ &=\sum_{d\leq x} f(d) D\left( \frac xd \right). \end{align} $$

In the formula $$ \sum_{n\leq x }\tau(kn) = \sum_{d\leq x } f(d) D\left( \frac xd \right), $$ we can compute each $D\left(\frac xd \right)$ in $O(\sqrt x)$ time. Moreover, the sum over $d\leq x$ is in fact a finite sum. We consider the computation times for $f(d)$. This can be done with $O(2^{w(k)})$ multiplications. The number of $d\geq 1$ such that $f(d)\neq 0$ is also $O(2^{w(k)})$. This gives a bound for computation time $O(4^{w(k)} \sqrt x)$.

Sungjin Kim
  • 20,850
  • You said so : $h(n) = C \tau(kn)$ is not multiplicative, so how do you get an Euler product for it ? Your factorization of the Dirichlet series into Euler factors is not correct since $h(n) \ne \prod_{p^k | n} h(p^k)$ – reuns Jul 11 '17 at 02:43
  • It is product over all primes. $h(n)$ also contain some $h(p^m)$ for prime $p$ that comes from $p^m |k$. So, not only prime factors from $n$ contribute to $\tau(kn)$, but also the prime factors from $k$ do so. – Sungjin Kim Jul 11 '17 at 02:47
  • Your formula $\sum_{n=1}^\infty \tau(nk)n^{-s} =\zeta(s)^2 \prod_{p^a||k}\left(1+a -\frac a{p^s}\right)$ implies that $\frac{\tau(kn)}{\tau(k)}$ is multiplicative, whereas it is not. With $k=2$ and $n,m$ odd : $\frac{\tau(2 (2n)(2m))}{\tau(2)} = \frac{\tau(8)}{\tau(2)}\tau(n)\tau(m) \ne \frac{\tau(4)^2}{\tau(2)^2}\tau(n)\tau(m)$ – reuns Jul 11 '17 at 02:56
  • Ah, you are saying about $\tau(kn)/\tau(k)$, not the $\tau(kn)$. I will check your comment more carefully. – Sungjin Kim Jul 11 '17 at 03:10
  • In your example, it seems that you are regarding multiplicative as $g(mn)=g(m)g(n)$ for all $m,n \in \mathbb{N}$. Your example is showing that $g(2n 2m) \neq g(2n) g(2m)$. And my definition I meant in my post, is $g(mn)=g(m)g(n)$ for all coprime $m, n$. – Sungjin Kim Jul 11 '17 at 03:15
  • Yes in my example I meant $k=2$, $n,m$ odd and $\frac{\tau(2 (n)(2m))}{\tau(2)} = \frac{\tau(4)}{\tau(2)}\tau(n)\tau(m) \ne \frac{\tau(2)}{\tau(2)^2}\tau(n)\tau(m)$ – reuns Jul 11 '17 at 03:21
  • I made a mistake in my answer. But to find a formula for $\sum_n \tau(nk) n^{-s}$ you'll need to find some Dirichlet characters $\chi_j$ such that $1_{k | n} = c\sum_j \chi_j(n)$ which is not possible in general – reuns Jul 11 '17 at 04:24
  • @user1952009 If you were trying to say that $n \mapsto \frac{\tau(2n)}{\tau(2)}$ is not multiplicative with example $k=2$, $n, m$ odd $(n,m)=1$, then $\frac{\tau(2(n)(2m))}{\tau(2)}=\frac{\tau(4)}{\tau(2)}\tau(n)\tau(m)$ and $\frac{\tau(2n)}{\tau(2)} \cdot \frac{\tau(2(2m))}{\tau(2)} = \tau(n) \cdot \frac{\tau(4)\tau(m)}{\tau(2)}$. – Sungjin Kim Jul 11 '17 at 12:18
  • Could you explain how you obtained $\prod_{p^a||k} \left(\sum_{v=0}^{\infty} \frac{a+v+1}{p^{vs}}\right)\left(\sum_{v=0}^{\infty} \frac{v+1}{p^{vs}}\right)^{-1} \zeta(s)^2$ being equal to $\prod_{p^a||k} \left(\left( 1-\frac1{p^s}\right)^{-2} +a \left(1-\frac1{p^s}\right)^{-1}\right) \left(1-\frac1{p^s}\right)^2 \zeta(s)^2$? – Vedvart1 Jul 11 '17 at 16:25
  • This is from Taylor series expansion. For $\sum_{v=0}^{\infty} a/p^{vs}$, it is geometric series that leads to $a(1-1/p^s)^{-1}$ and $\sum_{v=0}^{\infty} (v+1)/p^{vs}$ is Taylor series for $(1-1/p^s)^{-2}$. – Sungjin Kim Jul 11 '17 at 16:57
  • How would $f(x)$ be computed, apart from through basic approximation? Analytically, it seems difficult if not impossible to solve for $f(d)$ for any $d$ from the Dirichlet series. – Vedvart1 Jul 11 '17 at 17:39
  • The Dirichlet series has a finite product expression. So it can be computed directly expanding the product. – Sungjin Kim Jul 11 '17 at 17:48
  • One more question: what is $w(k)$ in the case of the complexity? I haven't seen that before. – Vedvart1 Jul 11 '17 at 18:11
  • If you are looking for prime factorization, here it is: https://en.wikipedia.org/wiki/Integer_factorization#Difficulty_and_complexity – Sungjin Kim Jul 11 '17 at 23:10