4
$\begingroup$

I've been trying to evaluate the sum

$$\sum_{k=0}^\infty \frac{m^k\bmod n}{m^k}$$

where $m$ and $n$ are positive integers greater than $1$ and $a\bmod b$ is the remainder when $a$ is divided by $b$. This came up in a combinatorics problem I was doing, and I know how to evaluate it given $m$ and $n$ (the numerators repeat, so it ends up just being geometric), but I'm not sure how to evaluate it generally.

Any ideas?

1 Answers 1

3

The numerators must repeat because only finitely many possible remainders exist. Suppose the repeating part starts after the first $K$ terms, so you have \begin{align} & \sum_{k=1}^K \frac{m^k\bmod n}{m^k} + \sum_{k=K+1}^\infty \frac{m^k\bmod n}{m^k} \\[10pt] = {} & \sum_{k=1}^K + \sum_{k=K+1}^{K+R} + \sum_{k=K+R+1}^{K+2R} + \sum_{k=K+2R+1}^{K+3R} + \cdots \\ & \text{where $R$ is the length of the repeating part} \\[10pt] = {} & \sum_{k=1}^K + \left(\sum_{k=K+1}^{K+R}\right)\left( 1 + \frac 1 {m^R} + \frac 1 {m^{2R}} + \frac 1 {m^{3R}} + \cdots \right) \\[10pt] = {} & \sum_{k=1}^K + \left(\sum_{k=K+1}^{K+R}\right)\left( \frac 1 {1- \dfrac 1 {m^R}} \right) \end{align}

  • 1
    Beautiful use of everything here!2017-02-02
  • 0
    Thanks! Is it possible to find $K$ and $R$ in closed form (I'm pretty sure we can assume $R=\phi(m)$ - is that correct)?2017-02-02
  • 0
    @CarlSchildkraut : Look at a few conrete examples. What if $m=3$ and $n=6\text{?}$ Then $R=1. \qquad$2017-02-03
  • 0
    @MichaelHardy So is there a way to find $K$ and $R$ in closed form that you know of? I know that for many cases (such as when $n|m$, for example) $R=1$, and for some other cases (like when $m$ is a primitive root mod $n$), $R=\phi(n)$. So, since the period divides $\phi(n)$, I think we can take $R$ to be $\phi(n)$ (am I right?). However, is there a nice formula for $K$?2017-02-03
  • 0
    @CarlSchildkraut : I'm not sure right now. Maybe I'll be back.2017-02-03
  • 0
    @MichaelHardy Someone I spoke to remarked that you can take $K\leq \lceil \log_2 n\rceil$, since, once $\nu_p(m^k) \geq \nu_p(n)$, the prime $p$ can no longer cause $m^k\bmod n$ not to repeat - so any $k \geq \left(\frac{\nu_p(n)}{\nu_p(m)} \leq \frac{\log_p(n)}{1} \leq \log_2(n)\right)$ will work. So, we can "nicely" represent it with a couple finite sums. Do you believe there might be a nicer way?2017-02-03