# Sum of series with binary parity in the numerator I'm now stuck with this question, and I don't eve

Sum of series with binary parity in the numerator
I'm now stuck with this question, and I don't even know where to start: Find sum of series
$\sum _{1}^{\mathrm{\infty }}\frac{f\left(n\right)}{n\left(n+1\right)}$
, where f(n) - number of ones in binary representation of n.
I wish I could post some moves, that I've tried but I don't know what to do.
Thanks!
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

iceniessyoy
Maybe there is a quicker way, but here is one. Let the sum be S. We have
$\frac{f\left(n\right)}{n\left(n+1\right)}=\frac{f\left(n\right)}{n}-\frac{f\left(n\right)}{n+1}$
$\phantom{\rule{thickmathspace}{0ex}}⟹\phantom{\rule{thickmathspace}{0ex}}\frac{f\left(2n\right)}{\left(2n\right)\left(2n+1\right)}+\frac{f\left(2n+1\right)}{\left(2n+1\right)\left(2n+2\right)}=\frac{f\left(2n\right)}{2n}-\frac{f\left(2n\right)-f\left(2n+1\right)}{2n+1}-\frac{f\left(2n+1\right)}{2n+2}$
Now $f\left(2n+1\right)=f\left(2n\right)+1,\phantom{\rule{thickmathspace}{0ex}}f\left(2n\right)=f\left(n\right)$, so we can write:
$\frac{f\left(2n\right)}{\left(2n\right)\left(2n+1\right)}+\frac{f\left(2n+1\right)}{\left(2n+1\right)\left(2n+2\right)}=\frac{f\left(2n\right)}{2n}+\frac{1}{2n+1}-\frac{f\left(2n\right)+1}{2n+2}\phantom{\rule{0ex}{0ex}}=\frac{1}{2}\left(\frac{f\left(n\right)}{n}-\frac{f\left(n\right)}{n+1}\right)+\left(\frac{1}{2n+1}-\frac{1}{2n+2}\right)$
$\phantom{\rule{thickmathspace}{0ex}}⟹\phantom{\rule{thickmathspace}{0ex}}S=\frac{1}{2}+\frac{1}{2}\sum _{n=1}^{\mathrm{\infty }}\frac{f\left(n\right)}{n\left(n+1\right)}+\sum _{n=1}^{\mathrm{\infty }}\left(\frac{1}{2n+1}-\frac{1}{2n+2}\right)$
$\phantom{\rule{thickmathspace}{0ex}}⟹\phantom{\rule{thickmathspace}{0ex}}2S=1+S+2\mathrm{log}2-1\phantom{\rule{thickmathspace}{0ex}}⟹\phantom{\rule{thickmathspace}{0ex}}S=2\mathrm{log}2\approx 1.386$
###### Did you like this example?
polivijuye
Code:
double sum=0;
for(int i=1;i<9999999;i++){
double s2=Integer.bitCount(i);
sum+=(s2)/(i*(i+1));
}
Output Data
$\begin{array}{rl}n& \sum \\ 9& 1.065079365079365\\ 99& 1.3394382621894894\\ 999& 1.3800972409478014\\ 9999& 1.3854974129587205\\ 99999& 1.3852676077956714\\ & \left(\text{limit of data type, therefore decreased value}\right)\end{array}$