As $\alpha$ and $\gamma$ range uniformly over $[0,1]$, what is the typical (e.g. median or root-mean-square) order of magnitude of $C\_m (\alpha,\gamma)$ := $\sum\_{1 \leq k \leq m} \left( {\rm frac}(k\alpha+\gamma) - \frac12 \right)$ where frac($x$) denotes the fractional part of $x$?


I'd settle for an answer in the case where $\gamma = 0$.


I know there are articles that address the question where $\alpha$ is fixed (going back to Hardy), but they don't immediately answer my question. Perhaps one could cobble together an answer using results about how the magnitude of $C\_m (\alpha,\gamma)$ is bounded in terms of the continued fraction convergents for $\alpha$, along with results about how the convergents grow for a generic real number.



sums of fractional parts of linear functions of n
I think I can show that
$$\sum\_{1 \leq h,k \leq N} \frac{GCD(h,k)^2}{hk}$$
grows linearly. But I get the constant is 
$$\sum\_{ GCD(i,j)=1} \frac{1}{\max(i,j) i j}$$
This constant is incredibly close to $3$. (I am omitting the $1/12$, so my $3$ is your $0.25$.) My intuition is that they can't be equal, but they agree to a lot of digits, so I am not sure. See below for my computations.


UPDATE: This constant is $3$, due to an identity of Euler. See Marty's answer [here](https://mathoverflow.net/questions/55141/does-this-sum-equal-zeta3). I'll leave the numeric work below for those might be curious how to approximate things like this.




---

  

Let's group the sum according to $GCD(h,k)$. So we have
$$\sum\_d \sum\_{\substack{1 \leq h,k \leq N \\ GCD(h,k)=d}} \frac{d^2}{hk} = \sum\_d \sum\_{\substack{1 \leq i,j \leq N/d \\ GCD(i,j)=1}} \frac{d^2}{d^2 ij} = \sum\_d \sum\_{\substack{1 \leq i,j \leq N/d \\ GCD(i,j)=1}} \frac{1}{ij}$$
where $h=di$ and $k=dj$. Grouping on $(i,j)$, we have
$$\sum\_{\substack{1 \leq i,j \leq N \\ GCD(i,j)=1}} \frac{\lfloor N/\max(i,j) \rfloor}{ij} = N \sum\_{\substack{1 \leq i,j \leq N \\ GCD(i,j)=1}} \frac{1}{\max(i,j) i j} + O \left( \sum\_{\substack{1 \leq i,j \leq N \\ GCD(i,j)=1}} \frac{1}{i j} \right)$$
The error term is $O(\log N)^2$, so that's not the dominant term.


Once we check that the sum converges, this will show that your rate of growth is linear with that coefficient. We'll drop the $GCD(i,j)=1$ condition, since that just makes the sum smaller.
$$\sum\_{i,j} \frac{1}{\max(i,j) i j} = \sum\_{n} \frac{1}{n^2} \left( 2 + \frac{2}{2} + \frac{2}{3} + \cdots + \frac{2}{n-1} + \frac{1}{n} \right) = \sum\_{n} n^{-2} O(\log n).$$
Here $n=\max(i,j)$. The final sum converges by the integral test, so the original one does as well.




---


Now, what is the value of this sum? Notice that, if $(i,j) = (g i', g j')$ with $GCD(i', j')=1$, then $\max(i,j)i j = g^3 \max(i',j') i' j'$. So, if we sum over all pairs, instead of just the relatively prime ones, then we multiply by a factor of $\sum g^{-3} = \zeta(3)$. So we want to compute
$$\sum\_{1 \leq i,j} \frac{1}{\max(i,j) i j}$$
and, in particular, we want to know how it compares to $3 \zeta(3)$. As we showed above, we can simplify this sum to
$$\sum\_{n} \frac{1}{n^2} \left( 2 + \frac{2}{2} + \frac{2}{3} + \cdots + \frac{2}{n-1} + \frac{1}{n} \right).$$


Now, is this actually the same as $3 \zeta(3)$? I had Mathematica compute the sum of the first $10,000$ terms, using $20$ digit precision for all intermediate computations. If Mathematica can be trusted, the result is $3.6040133$. Now, $2+2/2+2/3+\cdots +2/(n-1) + 1/n = 2 \log n + 2 \gamma + O(1/n)$. So I approximated the rest of the sum by the integral $\int\_{10000}^{\infty} 2 (\log t + \gamma) dt/t^2$. (Here $\gamma$ is the Euler gamma constant.) According to Mathematica, this integral is $0.0021575$. The error in approximating a decreasing sum by an integral is bounded by the first term, which is $1.8 \times 10^{-7}$. The error in approximating the harmonic number by a $\log$ should be something like $\int\_{10000}^{\infty} dt/t^3 = 5 \times 10^{-9}$; I don't have the energy to turn this into a rigorous bound. So the sum should be $3.6040133 + 0.0021575 \pm 2 \times 10^{-7} = 3.6061708 \pm 2 \times 10^{-7}$. (That error lines up with the last digit given.)


And what is $3 \zeta(3)$? I kid you not, it is $3.6061707$, right in range! So they might be equal, but, if so, I can't see why.


UPDATE: OK, I went back and improved my approximations in two ways: (1) I replaced the [Harmonic number](http://en.wikipedia.org/wiki/Harmonic_number) $H\_n$ by $\log n + \gamma + (1/2) n^{-1} - (1/12) n^{-2} + (1/120) n^{-4}$ and (2) I approximated the sum of the terms past $10000$ by the first few terms of the [Euler-Macluarin approximation](http://en.wikipedia.org/wiki/Euler%25E2%2580%2593Maclaurin_formula), up to the $B\_4$ term. The result, doing my internal computations with $20$ digits of accuracy: 3.6061707094787828562. The numerical value of $3 \zeta(3)$: Exactly the same!


Something is going on here. If you don't mind, I'll ask a separate question about what.


