Evenness sum grows with slope one-sixth Let $p_2(n)$ be the highest power of $2$ that divides $n$, i.e., if $2^k$ divides
$n$ and no higher power does, then $p_2(n)=k$.
Define $\;f_{oe}(k)$ as $+1$ if $k$ is odd, $-1$ if $k$ is even.
Finally, define $Ev(n)$ the sum over all even numbers $\le n$ of $\;f_{oe}( p_2(n) )$.
So, 
$$Ev(10) = f_{oe}( p_2(2) ) +f_{oe}( p_2(4) ) +f_{oe}( p_2(6) ) +f_{oe}( p_2(8) ) +f_{oe}( p_2(10) ) \;,$$
$$Ev(10) = f_{oe}( 1 ) +f_{oe}( 2 ) +f_{oe}( 1 ) +f_{oe}( 3 ) +f_{oe}( 1 ) \;,$$
$$Ev(10) = 1 -1 +1 +1 +1 = 3 \;.$$
Here is a graph of $Ev(n)$ up to $n=200$ followed by up to $n=2 \times 10^5$
(Edit: Changed from plotting $n/2$ along horizontal to plotting $n$):
   
   

Why is this graph almost exactly a straight line with slope $\frac{1}{6}$ ?

I am sure there is a sieve-like explanation based on powers of $2$, but I am not
seeing it...
 A: Let's do the analysis for $n=2^k$, a power of $2$. This is basically the same as for arbitrary numbers, just with a lot less $\lfloor\cdot\rfloor, \lceil\cdot\rceil$ and estimations involved.

Every other even number is not divisible by $4$. Since we have $\frac n2=2^{k-1}$ numbers in total, we will have $p_2(\cdot)=1$ for
$$\frac12\cdot2^{k-1}=2^{k-2}$$ 
numbers. That leaves us with $2^{k-2}$ numbers ($4,8,12,\dots$). Again, every second number is not divisible by $8$, so we have $p_2(\cdot)=2$ in
$$\frac12\cdot2^{k-2}=2^{k-3}$$ 
cases. Continuing like this, we obtain:
$$Ev(2^k)=f_{oe}(k)+\sum_{i=1}^{k-1}2^{k-1-i}\cdot f_{oe}(i)=(-1)^{k+1}+\sum_{i=0}^{k-2}(-1)^k(-2)^i=(-1)^{k+1}+(-1)^{k}\frac{1-(-2)^{k-1}}{1-(-2)}$$
$$=\frac{2^{k-1}+(-2)\cdot(-1)^k}{3}=\frac{2^k}{6}+\frac23(-1)^{k+1}\approx\frac{2^k}{6}$$
(You can formally prove the first equation by induction, the latter is just a geometric series)
So $Ev(n)\approx\frac n6$ for powers of two. 

As already mentioned, if $n$ is not a power of two, the calculation is similar, but nastier, and the error can be slightly bigger, but you will also get $Ev(n)\approx\frac n6$.
A: Only even power of two divisors of $n$ have a negative effect on each sum.  Each $2^{2k}$ divisor appears linearly across the span $[1,n]$.  Thus as $n$ increases, each $2^{2k}$ has an increasingly linear effect on the sum $Ev(n)$.
