An Infinite Series Involving a Sideways Sum
Published on 2013-07-03
I found a recent question on Mathematics Stack Exchange quite interesting. It simply asked
How does one easily calculate ∑ n = 1 ∞ p o p ( n ) n ( n + 1 ) \sum\limits_{n=1}^\infty\frac{\mathrm{pop}(n)}{n(n+1)} n = 1 ∑ ∞ n ( n + 1 ) pop ( n ) ?
Here p o p ( n ) \mathrm{pop}(n) pop ( n ) denotes the “population count” or “sideways sum”, which is the number of 1s in the binary representation of n n n (A000120 ).
The user achille hui provided a very nice answer which I would like to describe in some detail here. First, he introduces the function
θ k ( n ) = { 1 , if the k th bit of n is set, 0 , otherwise. \theta_k(n) = \begin{cases}1,&\text{ if the $k$th bit of $n$ is set,}\\0,&\text{ otherwise.}\end{cases}
θ k ( n ) = { 1 , 0 , if the k th bit of n is set, otherwise.
which makes it possible to write the series as
∑ n = 1 ∞ p o p ( n ) n ( n + 1 ) = ∑ n = 1 ∞ ∑ k = 0 ∞ θ k ( n ) n ( n + 1 ) = ∑ k = 0 ∞ ∑ n = 1 ∞ θ k ( n ) n ( n + 1 ) . \sum_{n=1}^\infty\frac{\mathrm{pop}(n)}{n(n+1)} = \sum_{n=1}^\infty \sum_{k=0}^\infty \frac{\theta_k(n)}{n(n+1)} = \sum_{k=0}^\infty \sum_{n=1}^\infty \frac{\theta_k(n)}{n(n+1)}.
n = 1 ∑ ∞ n ( n + 1 ) pop ( n ) = n = 1 ∑ ∞ k = 0 ∑ ∞ n ( n + 1 ) θ k ( n ) = k = 0 ∑ ∞ n = 1 ∑ ∞ n ( n + 1 ) θ k ( n ) .
After reversing the order of summation (which requires justification ), he asks: For fixed k k k , which values of n n n has θ k ( n ) = 1 \theta_k(n)=1 θ k ( n ) = 1 ? Note here that n n n has the k k k th bit set if and only if ⌊ n / 2 k ⌋ \lfloor n/2^k \rfloor ⌊ n / 2 k ⌋ has the zeroth bit set. And a number has the zeroth bit set if and only if that number is odd. So θ k ( n ) = 1 \theta_k(n)=1 θ k ( n ) = 1 if and only if ⌊ n / 2 k ⌋ = 2 l + 1 \lfloor n/2^k \rfloor = 2 l + 1 ⌊ n / 2 k ⌋ = 2 l + 1 for some l = 0 , 1 , 2 , … l = 0, 1, 2, \ldots l = 0 , 1 , 2 , … . This means
θ k ( n ) = 1 ⇔ 2 l + 1 ≤ n / 2 k < 2 l + 2 ⇔ ( 2 l + 1 ) 2 k ≤ n ≤ ( 2 l + 2 ) 2 k − 1 , \begin{aligned} \theta_k(n)=1 \quad&\Leftrightarrow\quad 2 l + 1 \leq n/2^k < 2 l + 2 \\ &\Leftrightarrow\quad (2 l + 1) 2^k \leq n \leq (2 l + 2) 2^k - 1, \end{aligned}
θ k ( n ) = 1 ⇔ 2 l + 1 ≤ n / 2 k < 2 l + 2 ⇔ ( 2 l + 1 ) 2 k ≤ n ≤ ( 2 l + 2 ) 2 k − 1 ,
for some l = 0 , 1 , 2 , … l = 0, 1, 2, \ldots l = 0 , 1 , 2 , … . This provides us with the intervals of n n n that we are interested in, so we have
∑ n = 1 ∞ p o p ( n ) n ( n + 1 ) = ∑ k = 0 ∞ ∑ n = 1 ∞ θ k ( n ) n ( n + 1 ) = ∑ k = 0 ∞ ∑ l = 0 ∞ ∑ n = ( 2 l + 1 ) 2 k ( 2 l + 2 ) 2 k − 1 1 n ( n + 1 ) = ∑ k = 0 ∞ ∑ l = 0 ∞ ∑ n = ( 2 l + 1 ) 2 k ( 2 l + 2 ) 2 k − 1 ( 1 n − 1 n + 1 ) = ∑ k = 0 ∞ ∑ l = 0 ∞ ( 1 ( 2 l + 1 ) 2 k − 1 ( 2 l + 2 ) 2 k ) = ( ∑ k = 0 ∞ 2 − k ) ( ∑ m = 1 ∞ ( − 1 ) m + 1 1 m ) = 2 ln 2 \begin{aligned} \sum_{n=1}^\infty\frac{\mathrm{pop}(n)}{n(n+1)} &= \sum_{k=0}^\infty \sum_{n=1}^\infty \frac{\theta_k(n)}{n(n+1)} \\ &= \sum_{k=0}^\infty \sum_{l=0}^\infty \sum_{n=(2 l + 1) 2^k}^{(2 l + 2) 2^k - 1} \frac{1}{n(n+1)} \\ &= \sum_{k=0}^\infty \sum_{l=0}^\infty \sum_{n=(2 l + 1) 2^k}^{(2 l + 2) 2^k - 1} \left( \frac{1}{n} - \frac{1}{n+1} \right) \\ &= \sum_{k=0}^\infty \sum_{l=0}^\infty \left( \frac{1}{(2 l + 1) 2^k} - \frac{1}{(2 l + 2) 2^k} \right) \\ &= \left( \sum_{k=0}^\infty 2^{-k} \right) \left( \sum_{m=1}^\infty (-1)^{m+1} \frac{1}{m} \right) \\ &= 2 \ln 2 \end{aligned}
n = 1 ∑ ∞ n ( n + 1 ) pop ( n ) = k = 0 ∑ ∞ n = 1 ∑ ∞ n ( n + 1 ) θ k ( n ) = k = 0 ∑ ∞ l = 0 ∑ ∞ n = ( 2 l + 1 ) 2 k ∑ ( 2 l + 2 ) 2 k − 1 n ( n + 1 ) 1 = k = 0 ∑ ∞ l = 0 ∑ ∞ n = ( 2 l + 1 ) 2 k ∑ ( 2 l + 2 ) 2 k − 1 ( n 1 − n + 1 1 ) = k = 0 ∑ ∞ l = 0 ∑ ∞ ( ( 2 l + 1 ) 2 k 1 − ( 2 l + 2 ) 2 k 1 ) = ( k = 0 ∑ ∞ 2 − k ) ( m = 1 ∑ ∞ ( − 1 ) m + 1 m 1 ) = 2 ln 2
Here, both a telescoping sum , a geometric progression sum (see Nice Proof of a Geometric Progression Sum with r = 1 / 2 r=1/2 r = 1/2 ) and the power series for the natural logarithm of 2 occurs.
Very nice.
Feel free to leave any question, correction or comment in this
Mastodon thread .