An alternating sum of the floor function of square roots
Marc Chamberland, Karl Dilcher
TL;DR
The paper proves that for every odd $n\ge 1$, the alternating sum $\sum_{j=1}^n (-1)^{j+1} \lfloor \sqrt{j n}\rfloor$ equals $(n+1)/2$, a striking result valid for all odd $n$ and stronger than the prime-restricted non-alternating analogue. The authors provide an elementary proof based on a rearrangement of the double sum and a parity argument, revealing a clean counting interpretation. They also derive an asymptotic expression for the non-floor analogue $\sum_{j=1}^n (-1)^{j+1} \sqrt{j n}$, namely $\frac{n}{2}+C\sqrt{n}+\frac{1}{8}+O(n^{-1})$, with an explicitly given constant $C$ expressed as a convergent series involving $\zeta$-values at half-integers. The work situates the result among lattice-point methods, contrasts it with prime-specific identities, and discusses potential inversion approaches and connections to class numbers, while noting the influence of AI-generated insight on the original approach.
Abstract
We show that the alternating sum of the floor function of $\sqrt{jn}$, with $j$ ranging from 1 to $n$, has an easy evaluation for all odd integers $n\geq 1$. This is in contrast to known non-alternating sums of the same type which hold only for a class of primes. The proof is elementary and was suggested by an AI model. To put this result in perspective, we also prove an asymptotic expression for the analogous sum without the floor function.
