If the sequence $x\_1,x\_2,\dots$ is periodic, the unweighted averages $(\sum\_{i=1}^n x\_i)/n$ converge to the asymptotic average of the $x\_n$'s with error $O(1/n)$, but the weighted averages $(\sum\_{i=1}^n i(n+1-i)x\_i)/(n(n+1)(n+2)/6))$ converge even more quickly, with error $O(1/n^2)$.


This fact is easy to prove (e.g. first prove it for $(x\_n) = (\zeta^n)$ with $\zeta$ an arbitrary root of unity and then appeal to linearity), but it's something I stumbled upon on my own, and I don't really understand what's going on. Can anyone provide a context for this fact? My guess is that it must be well-known to people who study series-convergence (and acceleration thereof), and also well-known to Fourier analysts, though possibly in disguised form. (Speaking of disguises: This question is related to my earlier question [A specific Dedekind-esque sum](https://mathoverflow.net/questions/26608/a-specific-dedekind-esque-sum) ; in my earlier post, the relevant sequence is almost-periodic rather than periodic, and the discrepancy goes down like $O((\log n)/n^2)$ rather than $O(1/n^2)$.)


I suspect that $O(1/n^2)$ is the end of the line, in the sense that no weighted average of $x\_1,\dots,x\_n$ with fixed coefficients will differ from the asymptotic average of the $x\_n$'s by $O(1/n^c)$ for any $c>2$, and I might even try to give a proof using the geometry of numbers, but I suspect this is old stuff and would appreciate some pointers.


Thanks!


Jim Propp



accelerated convergence to the mean using quadratic weights
Just think a bit of what the Poisson summation formula gives you for the function $\varphi\_n(x)=\varphi(x/n)$ where $\varphi$ is some not too bad compactly supported function (you can view the weighted $n$-th sum for the periodic sequence as the finite weighted sum of several infinite sums of values of $\varphi\_n$ over arithmetic progressions). The real end of line is almost exponential in $n$. 


Edit: Suppose that $\varphi$ is reasonably smooth and has integral $1$ (the characteristic function of an interval is not falling under this argument formally but the function $[x(1-x)]\_+$ already is). Now, let $P$ be the period and let the sequence be $a\_0,a\_1,\dots,a\_{P-1},a\_0,a\_1,\dots$. Then the $\varphi$ weighted sum 
$$
S\_n=\frac 1n \sum\_k\varphi\_n(k)a\_k=\frac 1P\sum\_{k=0}^{P-1}a\_k\sigma\_k
$$
where 
$$
\sigma\_k=\frac Pn\sum\_m\varphi\_n(k+mP)= \sum\_m\widehat\varphi(mn/P)e^{2\pi i mk/P}
$$
by the Poisson summation formula. 
Now, $|\sigma\_k-1|\le\sum\_{m\ne 0}|\widehat\varphi(mn/P)|$ and, if $\widehat\varphi$ decays fast (which you can always achieve by making $\varphi$ smooth enough), this bound decays fast with $n$.


You may object that one has to divide not by $n$ but by $\sum\_k \varphi\_n(k)$ but it is close to $n$ with the same relative precision (just run the same argument for the sequence consisting of all ones).


