2025-11-16T03:49:11.952197

An alternating sum of the floor function of square roots

Chamberland, Dilcher
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.
academic

An alternating sum of the floor function of square roots

Basic Information

  • Paper ID: 2510.26291
  • Title: An alternating sum of the floor function of square roots
  • Authors: Marc Chamberland (Grinnell College), Karl Dilcher (Dalhousie University)
  • Classification: math.NT (Number Theory)
  • Submission Date: October 30, 2025 to arXiv
  • Paper Link: https://arxiv.org/abs/2510.26291

Abstract

This paper proves that for all odd integers n1n \geq 1, the alternating sum of the floor function of jn\sqrt{jn} (with jj ranging from 1 to nn) has a concise closed form. This contrasts with the known non-alternating sum—which holds only for certain classes of primes. The proof method is elementary and was suggested by an AI model. To place the result in proper context, the authors also prove an asymptotic expression for the analogous sum without the floor function.

Research Background and Motivation

1. Research Problem

This paper investigates the exact computation of alternating sums involving the floor function of square roots, particularly focusing on sums of the form j=1n(1)j+1jn\sum_{j=1}^{n}(-1)^{j+1}\lfloor\sqrt{jn}\rfloor.

2. Problem Significance

  • Classical Background: A classical work by Pólya and Szegő contains a famous identity (the Bouniakowski identity): for primes p1(mod4)p \equiv 1 \pmod{4}, j=1p14jp=p2112\sum_{j=1}^{\frac{p-1}{4}}\lfloor\sqrt{jp}\rfloor = \frac{p^2-1}{12}
  • Theoretical Value: Sums of floor functions hold an important place in number theory, closely related to lattice point counting and Diophantine approximation problems
  • Comparative Significance: Non-alternating sums hold only for primes of specific forms, making it a natural question whether alternating sums exhibit more general patterns

3. Limitations of Existing Methods

  • The Bouniakowski identity applies only to primes p1(mod4)p \equiv 1 \pmod{4}
  • For the case p3(mod4)p \equiv 3 \pmod{4}, the problem involves class numbers of imaginary quadratic fields, which is more complex
  • No known results exist for alternating sums
  • The summation is restricted to (p1)/4(p-1)/4 rather than the complete range

4. Research Motivation

  • To explore whether similar identities exist for broader classes of integers
  • To investigate how alternation affects the properties of sums
  • To compare the behavior with and without the floor function

Core Contributions

  1. Main Theorem: Proves that for all odd integers n1n \geq 1, the exact identity holds: j=1n(1)j+1jn=n+12\sum_{j=1}^{n}(-1)^{j+1}\lfloor\sqrt{jn}\rfloor = \frac{n+1}{2}
  2. Breakthrough in Universality: This result applies to all odd integers, not just specific primes, significantly extending the scope of applicability
  3. Asymptotic Analysis: Proves the asymptotic expression for the corresponding sum without the floor function: j=1n(1)j+1jn=n2+Cn+18+O(1n)\sum_{j=1}^{n}(-1)^{j+1}\sqrt{jn} = \frac{n}{2} + C\sqrt{n} + \frac{1}{8} + O\left(\frac{1}{n}\right) where C0.3801C \approx 0.3801 can be expressed as an explicit infinite series
  4. Methodological Innovation: The proof is suggested by an AI model (Google Gemini), demonstrating the potential of AI-assisted mathematical proofs
  5. Theoretical Insight: Reveals how the floor operation transforms the error term Cn+18+O(1/n)C\sqrt{n} + \frac{1}{8} + O(1/n) into a concise constant 12\frac{1}{2}

Detailed Methods

Task Definition

Input: An odd integer n1n \geq 1
Output: Compute the exact value of the alternating sum j=1n(1)j+1jn\sum_{j=1}^{n}(-1)^{j+1}\lfloor\sqrt{jn}\rfloor
Constraint: nn must be odd

Proof Architecture of the Main Theorem

Step One: Rewrite as a Double Sum

Using the identity jn=k=1jn1\lfloor\sqrt{jn}\rfloor = \sum_{k=1}^{\lfloor\sqrt{jn}\rfloor}1, rewrite the original sum as: j=1n(1)j+1jn=j=1n(1)j+1k=1jn1\sum_{j=1}^{n}(-1)^{j+1}\lfloor\sqrt{jn}\rfloor = \sum_{j=1}^{n}(-1)^{j+1}\sum_{k=1}^{\lfloor\sqrt{jn}\rfloor}1

Step Two: Exchange the Order of Summation

Note that kjnk \leq \sqrt{jn} is equivalent to jk2/nj \geq k^2/n, therefore: j=1n(1)j+1k=1jn1=k=1nj=k2/nn(1)j+1\sum_{j=1}^{n}(-1)^{j+1}\sum_{k=1}^{\lfloor\sqrt{jn}\rfloor}1 = \sum_{k=1}^{n}\sum_{j=\lceil k^2/n\rceil}^{n}(-1)^{j+1}

Step Three: Analyze the Inner Alternating Sum

For fixed kk, the value of the inner sum j=k2/nn(1)j+1\sum_{j=\lceil k^2/n\rceil}^{n}(-1)^{j+1} depends on the parity of the starting term k2/n\lceil k^2/n\rceil:

  • When k2/n\lceil k^2/n\rceil is odd: The first term is +1+1, subsequent terms are 1,+1,1,+1,-1, +1, -1, +1, \ldots, and after pairing cancellations, +1+1 remains
  • When k2/n\lceil k^2/n\rceil is even: The first term is 1-1, all terms pair up completely and cancel, giving sum 0

Therefore: j=1n(1)j+1jn=#{1knk2/n is odd}\sum_{j=1}^{n}(-1)^{j+1}\lfloor\sqrt{jn}\rfloor = \#\{1 \leq k \leq n \mid \lceil k^2/n\rceil \text{ is odd}\}

Step Four: Count Parity Pairings

Key observation: For odd nn, (nk)2n=n2k+k2n=n2k+k2n\left\lceil\frac{(n-k)^2}{n}\right\rceil = \left\lceil n - 2k + \frac{k^2}{n}\right\rceil = n - 2k + \left\lceil\frac{k^2}{n}\right\rceil

Since nn is odd, n2kn - 2k is also odd, therefore (nk)2/n\lceil(n-k)^2/n\rceil and k2/n\lceil k^2/n\rceil have opposite parity.

Step Five: Final Counting

  • When k=nk = n, n2/n=n\lceil n^2/n\rceil = n is odd, contributing 1
  • For k{1,2,,n12}k \in \{1, 2, \ldots, \frac{n-1}{2}\}, each kk pairs with nkn-k, and exactly one makes k2/n\lceil k^2/n\rceil odd

Therefore, the total count is: 1+n12=n+121 + \frac{n-1}{2} = \frac{n+1}{2}

Technical Innovations

  1. Clever Application of Order Exchange: By converting a single-layer sum into a double sum, the combinatorial structure of the problem is revealed
  2. Parity Pairing Argument: Utilizing the property that nn is odd, establishes a symmetric relationship between kk and nkn-k
  3. Counting Method: Transforms the summation problem into a set counting problem, making the proof more intuitive
  4. AI-Assisted Proof: The proof framework suggested by Google Gemini is simplified and rewritten by the authors, demonstrating a human-machine collaborative paradigm for mathematical research

Alternative Method (Incomplete)

The paper also proposes an alternative method based on differences: dn():=2n(21)nd_n(\ell) := \lfloor\sqrt{2\ell n}\rfloor - \lfloor\sqrt{(2\ell-1)n}\rfloor

Conjecture 2.1: If δ:=dn(λ)2\delta := d_n(\lambda) \geq 2, then there exist δ1\delta-1 consecutive positions where dn()=0d_n(\ell) = 0, and these sets of zeros are pairwise disjoint.

If this conjecture holds, it would imply the main theorem, but the proof involves complex technical lemmas that the authors have not fully completed.

Asymptotic Analysis (Proof of Theorem 1.3)

Method Overview

Proves the asymptotic expansion of the sum without the floor function, revealing the "smoothing" effect of the floor operation.

Step One: Rewrite the Sum

j=1n(1)j+1jn=nnm=1n12(2m2m+1)\sum_{j=1}^{n}(-1)^{j+1}\sqrt{jn} = \sqrt{n} - \sqrt{n}\sum_{m=1}^{\frac{n-1}{2}}\left(\sqrt{2m} - \sqrt{2m+1}\right)=nnm=1n122m(11+(2m)1)= \sqrt{n} - \sqrt{n}\sum_{m=1}^{\frac{n-1}{2}}\sqrt{2m}\left(1 - \sqrt{1 + (2m)^{-1}}\right)

Step Two: Binomial Expansion

Using a special case of the binomial theorem (α=1/2\alpha = 1/2): 1x=k=0(2kk)xk(12k)4k,x<1\sqrt{1-x} = \sum_{k=0}^{\infty}\binom{2k}{k}\frac{x^k}{(1-2k)4^k}, \quad |x| < 1

Obtain: 11+(2m)1=k=112k1(2kk)(18m)k1 - \sqrt{1 + (2m)^{-1}} = \sum_{k=1}^{\infty}\frac{1}{2k-1}\binom{2k}{k}\left(\frac{-1}{8m}\right)^k

Step Three: Exchange Summation and Apply Zeta Function Estimates

m=1n122m(11+(2m)1)=2k=1(1)k(2k1)8k(2kk)m=1n121mk1/2\sum_{m=1}^{\frac{n-1}{2}}\sqrt{2m}\left(1 - \sqrt{1 + (2m)^{-1}}\right) = \sqrt{2}\sum_{k=1}^{\infty}\frac{(-1)^k}{(2k-1)8^k}\binom{2k}{k}\sum_{m=1}^{\frac{n-1}{2}}\frac{1}{m^{k-1/2}}

Using partial sum estimates for the Riemann zeta function: m=1N1ms=ζ(s)+N1s1s+12Ns+O(Ns1)\sum_{m=1}^{N}\frac{1}{m^s} = \zeta(s) + \frac{N^{1-s}}{1-s} + \frac{1}{2N^s} + O(N^{-s-1})

Step Four: Separate Main Terms

Taking N=n12N = \frac{n-1}{2} and s=k12s = k - \frac{1}{2}:

  • k=1k=1 term: Produces the leading term 12n-\frac{1}{2}\sqrt{n}
  • k=2k=2 term: Produces the correction term 18n\frac{1}{8\sqrt{n}}
  • k3k \geq 3 terms: Contribute O(n3/2)O(n^{-3/2})

Step Five: Identify the Constant Term

C=1+2k=1(1)k+1(2k1)8k(2kk)ζ(k12)C = 1 + \sqrt{2}\sum_{k=1}^{\infty}\frac{(-1)^{k+1}}{(2k-1)8^k}\binom{2k}{k}\zeta\left(k - \frac{1}{2}\right)

Numerical computation gives C0.3801C \approx 0.3801.

Key Insight

The floor operation transforms the complex error term Cn+18+O(1/n)C\sqrt{n} + \frac{1}{8} + O(1/n) into a simple constant 12\frac{1}{2}, which is a surprising "regularization" phenomenon.

Experimental Setup

Numerical Verification

The paper verifies the main theorem and asymptotic formulas through numerical experiments:

  1. Main Theorem Verification: For multiple odd integers nn (such as n=33n = 33), compute the alternating sum and verify that the result is indeed n+12\frac{n+1}{2}
  2. Difference Distribution: Table 1 shows the distribution of d33()d_{33}(\ell) for n=33n=33:
    • {1,,16}\ell \in \{1, \ldots, 16\}
    • d33(){0,1,2,3}d_{33}(\ell) \in \{0, 1, 2, 3\}
    • Observe that d33(1)=3d_{33}(1) = 3 corresponds to two consecutive zeros
  3. Asymptotic Formula Verification: Compute the sum without the floor function and verify agreement with the asymptotic formula

Implementation Details

  • Use exact integer arithmetic to compute the floor function
  • For asymptotic analysis, require high-precision floating-point arithmetic to verify the value of constant CC
  • Use AI model (Google Gemini) to explore proof strategies

Experimental Results

Main Results

  1. Verification of Theorem 1.1:
    • For all tested odd integers nn, the formula j=1n(1)j+1jn=n+12\sum_{j=1}^{n}(-1)^{j+1}\lfloor\sqrt{jn}\rfloor = \frac{n+1}{2} holds
    • Results are completely exact (not approximate)
  2. Verification of Theorem 1.3:
    • The asymptotic formula improves in accuracy as nn \to \infty
    • The constant C0.3801C \approx 0.3801 can be precisely represented by an infinite series

Case Analysis

Case: n=33n = 33

Table 1 shows the values of the difference d33()=233(21)33d_{33}(\ell) = \lfloor\sqrt{2\ell \cdot 33}\rfloor - \lfloor\sqrt{(2\ell-1) \cdot 33}\rfloor:

\ell12345678910111213141516
d33()d_{33}(\ell)3221101010011111

Observations:

  • d33(1)=3d_{33}(1) = 3 "compensates" for the two zero values at =10,11\ell = 10, 11
  • d33(2)=2d_{33}(2) = 2 compensates for the zero value at =8\ell = 8
  • Total sum: 3+2+2+1+1+0++1=16=33123 + 2 + 2 + 1 + 1 + 0 + \cdots + 1 = 16 = \frac{33-1}{2}

This verifies the pattern of Conjecture 2.1.

Experimental Findings

  1. Universality: The simplicity of the alternating sum does not depend on whether nn is prime or has special arithmetic properties, only requiring nn to be odd
  2. Symmetry: The pairing relationship between kk and nkn-k is central to the proof, reflecting profound symmetry
  3. Regularization Effect: The floor operation eliminates all non-constant terms in the asymptotic expansion
  4. AI Assistance: AI models can suggest correct proof frameworks, but require human simplification and rigorization

1. Bouniakowski Identity (1882)

j=1p14jp=p2112,p1(mod4) prime\sum_{j=1}^{\frac{p-1}{4}}\lfloor\sqrt{jp}\rfloor = \frac{p^2-1}{12}, \quad p \equiv 1 \pmod{4} \text{ prime}

  • The earliest related result
  • Applies only to specific prime classes
  • Proof involves lattice point counting techniques

2. Pólya and Szegő's Work (1976)

  • Includes the Bouniakowski identity as an exercise
  • Provides systematic methods for lattice point counting
  • Emphasizes geometric perspectives in number theory

3. Shirali's Alternative Proof (1997)

  • Provides a more modern proof of the identity
  • Uses different technical approaches
  • For the case p3(mod4)p \equiv 3 \pmod{4}, the sum involves the class number of the imaginary quadratic field Q(p)\mathbb{Q}(\sqrt{-p})
  • Provides generalizations of multiple related identities

5. Liouville Function Identities

Works by De Koninck and Doyon contain the identity: k=d=1kλ(d)kd\lfloor\sqrt{k}\rfloor = \sum_{d=1}^{k}\lambda(d)\left\lfloor\frac{k}{d}\right\rfloor where λ(n)=(1)Ω(n)\lambda(n) = (-1)^{\Omega(n)} is the Liouville function.

Advantages of This Paper

  1. Broader Applicability: All odd integers vs. specific prime classes
  2. Simpler Results: n+12\frac{n+1}{2} vs. complex expressions involving class numbers
  3. Complete Asymptotic Analysis: Provides comparison with and without the floor function
  4. Methodological Innovation: Demonstrates the feasibility of AI-assisted proofs

Conclusions and Discussion

Main Conclusions

  1. Exact Formula: For all odd integers n1n \geq 1, j=1n(1)j+1jn=n+12\sum_{j=1}^{n}(-1)^{j+1}\lfloor\sqrt{jn}\rfloor = \frac{n+1}{2}
  2. Asymptotic Contrast: Without the floor function, j=1n(1)j+1jn=n2+Cn+18+O(n1)\sum_{j=1}^{n}(-1)^{j+1}\sqrt{jn} = \frac{n}{2} + C\sqrt{n} + \frac{1}{8} + O(n^{-1}) The floor operation eliminates the n\sqrt{n}-order error term
  3. Methodology: AI models (Google Gemini) can suggest effective proof strategies

Limitations

  1. Odd Number Restriction: Theorem 1.1 applies only to odd nn; the even case is not discussed
  2. Conjecture 2.1 Incomplete: The alternative proof method based on differences involves complex lemmas that remain unfinished
  3. Rigor of AI Proofs: AI-suggested proofs require human verification and simplification and cannot be used directly
  4. Limited Applications: Due to lack of arithmetic structure, it is difficult to apply classical inversion formulas (such as Möbius inversion)
  5. Closed Form of Constant CC: Although a series representation is provided, it is not a simple elementary function

Future Directions

  1. Even Case: Investigate the behavior of alternating sums when nn is even
  2. Complete Conjecture 2.1: Simplify technical lemmas and complete the difference-based proof
  3. Generalize to Other Functions: Study alternating sums of jnk\lfloor\sqrt[k]{jn}\rfloor and similar functions
  4. Connection to Modular Forms: Explore possible connections with modular form theory
  5. AI-Assisted Mathematics: Systematically investigate the potential of AI in number-theoretic proofs
  6. Computational Complexity: Study efficient algorithms for computing these sums

In-Depth Evaluation

Strengths

1. Mathematical Elegance

  • Simple Result: The right-hand side is merely n+12\frac{n+1}{2}, extremely concise
  • Universality: Applies to all odd integers, not just special subclasses
  • Sharp Contrast: Forms a striking contrast with the restrictions of the Bouniakowski identity

2. Proof Technique

  • Elementary Method: Does not rely on deep theories, easy to understand
  • Clever Transformation: Converts the summation into a counting problem
  • Symmetry Exploitation: Fully utilizes the property that nn is odd

3. Completeness

  • Dual Perspective: Provides both exact formulas and asymptotic analysis
  • Comparative Study: Reveals the "regularization" effect of the floor operation
  • Alternative Approach: Proposes an alternative difference-based perspective

4. Methodological Contribution

  • AI-Assisted Proof: First demonstration (in number theory) of AI-suggested proofs
  • Human-Machine Collaboration: Shows the combination of AI suggestions with human rigorization
  • Transparency: Clearly states AI contributions and human modifications

5. Writing Clarity

  • Clear logic and detailed steps
  • Provides concrete numerical examples
  • Rich historical background

Weaknesses

1. Scope of Applicability

  • Odd Number Restriction: Even case is completely untouched, limiting result completeness
  • No Generalization: Does not explore possibilities of extending to jnk\sqrt[k]{jn} or other functions

2. Proof Completeness

  • Unproven Conjecture: Conjecture 2.1 provides an alternative perspective but remains unproven
  • Missing Technical Details: For the incomplete proof, does not explain specific difficulties

3. Application Value

  • Theory-Oriented: Primarily a pure mathematics result, lacking clear applications
  • Missing Arithmetic Structure: As the authors note, lack of arithmetic structure limits further applications

4. AI Contribution Assessment

  • Vague Contribution: Does not detail the original form of AI suggestions
  • Reproducibility: Does not provide detailed records of AI interactions
  • Generality Unknown: Unclear whether this method applies to other problems

5. Insufficient Numerical Verification

  • Limited Cases: Only shows detailed case for n=33n=33
  • Asymptotic Precision: Does not provide error analysis of asymptotic formula for different nn values
  • Constant Calculation: Does not detail how to numerically compute constant CC

Impact

1. Contribution to Number Theory

  • Extends Classical Results: Generalizes ideas from the Bouniakowski identity to new contexts
  • New Techniques: Parity pairing arguments may apply to other problems
  • Theoretical Insight: Reveals interaction between alternation and floor function

2. Contribution to AI-Assisted Mathematics

  • Pioneering: Demonstrates feasibility of AI-assisted proofs in number theory
  • Stimulates Discussion: Raises questions about AI's role in mathematical research
  • Methodological Example: Successful case of human-machine collaboration

3. Practical Value

  • Limited: Primarily a theoretical result with unclear direct applications
  • Educational Value: Can serve as elegant example in elementary number theory
  • Inspirational: May inspire research on related problems

4. Reproducibility

  • Verifiable Proof: Proof steps are clear and easy to verify
  • Reproducible Computation: Calculations can be implemented with standard mathematical software
  • Non-Reproducible AI Part: AI interaction process not fully recorded

Applicable Scenarios

1. Theoretical Research

  • Lattice point counting problems in number theory
  • Diophantine approximation theory
  • Analysis of properties of floor functions

2. Teaching Applications

  • Number theory courses: examples showing power of elementary methods
  • Combinatorics: summation techniques and symmetry arguments
  • Computational mathematics: contrast between exact computation and asymptotic analysis

3. Methodological Research

  • Case studies of AI-assisted mathematical proofs
  • Mathematical research models with human-machine collaboration
  • Computational methods for mathematical discovery
  • Other sums involving floor functions
  • General theory of alternating sums
  • Discovery and proof of similar identities

References

Key Literature Cited in the Paper

  1. V. Bouniakowski (1882): "Démonstration d'un théorème relatif à la fonction E(x)"
    • Original Bouniakowski identity
  2. G. Pólya and G. Szegő (1976): "Problems and Theorems in Analysis, Vol. II"
    • Includes identity (1.1) as an exercise
  3. S. A. Shirali (1997): "A family portrait of primes—A case study in discrimination"
    • Provides alternative proof of identity (1.1)
  4. H. M. Edwards (2001): "Riemann's Zeta Function"
    • Reference for zeta function partial sum estimates
  5. M. Chamberland and K. Dilcher (2025): "Sums of the floor function related to class numbers"
    • Authors' related work extending to class numbers
  6. Google Gemini (2025): AI Model
    • Suggested proof framework for main theorem

Summary

This is an elegant number theory paper proving a concise and universal identity. Main highlights include:

  1. Result applies to all odd integers, not just special primes
  2. Proof is elementary and clever, utilizing parity pairing
  3. Provides complete asymptotic analysis for comparison
  4. Demonstrates potential of AI-assisted mathematical proofs

Main limitations include:

  1. Applies only to odd integers
  2. Lacks clear applications
  3. AI contribution details insufficiently transparent

Overall, this is an interesting pure mathematics result demonstrating the power of elementary methods and the possibility of AI-assisted research, with contributions to both number theory and mathematical methodology.