Summiation of the greatest integer function with terms of dedekind sums

27 Views Asked by At

I try to sum the greatest integer function like: $$\sum_{i,j=0}^{m-1}\left\lfloor\frac{in_1 +jn_2}{m}\right\rfloor$$
This can be solved by using Hermite formula : $$\sum_{j=0}^{m-1} \left\lfloor\frac{jn}{m}+x\right\rfloor=\lfloor mx\rfloor+\frac{1}{2}(m-1)(n-1)$$ so: $$\sum_{i,j=0}^{m-1}\lfloor\frac{in_1 +jn_2}{m}\rfloor=\sum_{j=0}^{m-1}(\lfloor jn_2\rfloor +\frac{1}{2}(m-1)(n_1 -1))$$ and due to $jn_2$ is integer now, so $\lfloor jn_2\rfloor=jn_2$ so: $$\sum_{j=0}^{m-1}(\lfloor jn_2\rfloor+\frac{1}{2}(m-1)(n_1 -1))=\sum_{j=0}^{m-1}(jn_2+\frac{1}{2}(m-1)(n_1 -1))=\frac{1}{2}m(m-1)(n_1 +n_2 -1)$$ However, when i try to caculate: $$\sum_{i,j=0}^{m-1}\lfloor \frac{in_1 +jn_2}{m}\rfloor^2$$ The same way doesn't work. I read a paper about the Dedekind eta function and find a formula: $$2h s(h,k)+\sum_{r=1}^{k-1}\lfloor \frac{h r}{k}\rfloor(\lfloor \frac{hr}{k}\rfloor+1)=\frac{h^2 +1}{6k}(k-1)(2k-1)\ \ (\ where\ s(h,k)=\sum_{r=1}^{k-1} \frac{r}{k}(\frac{hr}{k}-\lfloor \frac{hr}{k}\rfloor-\frac{1}{2})\ $$ the s(h,k) is called Dedekind sums. That inspired me because i can get : $$\sum_{i=1}^{m-1}\lfloor \frac{in}{m}\rfloor^2=\frac{n^2 +1}{6m}(2m-1)(m-1)-\frac{1}{2}(m-1)(n-1)-\frac{1}{2}(m-1)-2n\ s(n,m)$$ But then i don't know what to do next. I can caculate$\sum\limits_{i,j=0}^{m-1}\lfloor \frac{in_1 +jn_2}{m}\rfloor$ and $\sum\limits_{i=1}^{m-1}\lfloor \frac{in}{m}\rfloor^2$. But when it comes to $\sum\limits_{i,j=0}^{m-1}\lfloor \frac{in_1 +jn_2}{m}\rfloor^2$, i have no ideas...(the terms of Dedekind sums in answers can be remained.)