---
title: 'Dedekind Sum: Theory and Applications'
url: https://www.emergentmind.com/topics/dedekind-sum
type: topic
---

# Dedekind Sum: Theory and Applications

A Dedekind sum is a classical arithmetic sum attached to a pair of coprime integers and defined from the sawtooth, or first periodic Bernoulli, function. In normalized form \(S(a,b)=12\,s(a,b)\), Dedekind sums occupy a central place in the theory of modular forms and the arithmetic of cyclotomic fields, arise from the transformation law of the logarithm of the Dedekind \(\eta\)-function, and extend naturally to Dedekind symbols for non-cocompact lattices and to character-twisted sums attached to Eisenstein series on congruence subgroups [1809.03038] [2405.00274]. Modern work studies their reciprocity laws, equality and congruence phenomena, extremal growth, continued-fraction asymptotics, distribution, and higher-weight generalizations [1607.07682].

## 1. Classical definition and normalization

For coprime integers \(a\in \mathbb Z\) and \(b\in \mathbb N\), the sawtooth function is
\[
((x))=
\begin{cases}
x-\lfloor x\rfloor-\tfrac12,&x\notin\mathbb Z,\\
0,&x\in\mathbb Z,
\end{cases}
\]
and the classical Dedekind sum is
\[
s(a,b)=\sum_{k=1}^{b-1}\Bigl(\!\bigl(\tfrac{k}{b}\bigr)\!\Bigr)\,
\Bigl(\!\bigl(\tfrac{ak}{b}\bigr)\!\Bigr).
\]
It is standard to use the normalized sum
\[
S(a,b)=12\,s(a,b),
\]
with \(b\) called the modulus and \(a\) the argument [2102.06374].

Equivalent formulations use the first Bernoulli function \(B_1(x)\), or the fractional-part function \(\{x\}=x-\lfloor x\rfloor\). In particular, the classical theory repeatedly exploits the periodicity \(S(a+b,b)=S(a,b)\), so the argument may be treated modulo \(b\), and the symmetry \(s(-a,b)=-s(a,b)\) [1309.4226]. Some authors also record the conventions \(S(m,-n)=S(m,n)\) and \(S(m+n,n)=S(m,n)\), which make reciprocity formulas cleaner [1607.07682].

The normalization by \(12\) is not cosmetic. It is the scale at which reciprocity, congruence, denominator, and equal-value questions take their simplest arithmetic form. Much of the later literature formulates structural problems directly for \(S(a,b)\), then translates back to \(s(a,b)\) only at the end.

## 2. Reciprocity and modular origin

The classical reciprocity law states that for coprime positive integers \(a\) and \(c\),
\[
s(a,c)+s(c,a)=
-\tfrac14+\tfrac1{12}\Bigl(\tfrac ac+\tfrac ca+\tfrac1{ac}\Bigr).
\]
Equivalently,
\[
S(a,c)+S(c,a)=\frac{a}{c}+\frac{c}{a}+\frac1{ac}-3.
\]
This identity is one of the defining structural facts of the subject and, together with periodicity, allows computation of Dedekind sums by the Euclidean algorithm [1609.03588].

The modular origin of the reciprocity law is the transformation behavior of the Dedekind \(\eta\)-function
\[
\eta(z)=e^{\pi i z/12}\prod_{n=1}^\infty(1-e^{2\pi i n z}),\qquad z\in\mathbb H.
\]
For \(\gamma=\begin{pmatrix}a&b\\ c&d\end{pmatrix}\in SL_2(\mathbb Z)\), one has
\[
\log\eta(\gamma z)
=
\log\eta(z)+\tfrac12\log(cz+d)+i\pi\,\phi(\gamma),
\]
where
\[
\phi\!\bigl(\begin{smallmatrix}a&b\\ c&d\end{smallmatrix}\bigr)
=
\begin{cases}
\tfrac{b}{12d},&c=0,\\[4pt]
\tfrac{a+d}{12c}-\operatorname{sign}(c)\,s(a,|c|),&c\neq 0.
\end{cases}
\]
Comparison of the imaginary part as \(z\) varies recovers the reciprocity law [1809.03038].

This modular interpretation is reinforced by Kronecker’s first limit formula, which links logarithms of \(\eta\)-values to constant terms of Eisenstein-series expansions. In the classical setting, Dedekind sums therefore measure the defect between modular transformation and simple algebraic scaling. A recurring theme in later work is that generalized Dedekind sums arise whenever a comparable transformation law or cocycle is extracted from an Eisenstein series or modular-symbol construction.

## 3. Equality, congruences, and arithmetic classification

A basic distinction in the literature is between exact equality of Dedekind sums, equality modulo \(\mathbb Z\), and equality modulo a larger lattice such as \(8\mathbb Z\) or \(24\mathbb Z\). For the normalized sums, Girstmair proved the sharp criterion
\[
S(m_1,n)-S(m_2,n)\in\mathbb Z
\quad\Longleftrightarrow\quad
(m_1m_2-1)(m_1-m_2)\equiv 0\pmod n,
\]
for integers \(m_1,m_2\) coprime to \(n\) [1304.4716]. The same congruence is the criterion for equal fractional parts:
\[
S(x,n)\equiv S(m,n)\pmod 1
\quad\Longleftrightarrow\quad
(x-m)(xm-1)\equiv 0\pmod n,
\]
and the number of such \(x\) can be counted exactly by reducing to prime powers and applying the Chinese remainder theorem [1309.4226].

Exact equality is subtler. Girstmair showed that deciding whether \(S(c,b)=S(d,b)\) is equivalent to deciding whether a single larger Dedekind sum takes a specific value. If \(t\) is the unique integer with \(t\equiv c-d\pmod b\) and \(1\le t\le b-1\), then
\[
S(c,b)=S(d,b)
\quad\Longleftrightarrow\quad
S(1+ct,bt)=\frac{t^2+2}{bt}-3.
\]
The same paper constructs infinite sequences of pairwise equal Dedekind sums and studies the multiplicity
\[
N(c,b)=\bigl|\{\,d\in\{1,\dots,b-1\}:(d,b)=1,\ S(d,b)=S(c,b)\}\bigr|.
\]
When \(b=p_1\cdots p_r\) is square-free, it is known that \(N(c,b)\le 2^r\), and the paper shows that every power of two up to \(2^r\) actually occurs; in particular, if the primes \(p_i\equiv \pm1\pmod 5\), then one obtains examples with \(N(c,b)=2^k\) for any \(1\le k\le r\) [2102.06374].

Congruence refinements sharpen this picture further. Tsukerman gave a necessary and sufficient condition for
\[
S(a_1,b)-S(a_2,b)\in 8\mathbb Z,
\]
and Girstmair showed that when \(9\nmid b\), the same condition is equivalent to
\[
S(a_1,b)-S(a_2,b)\in 24\mathbb Z.
\]
The restriction \(9\nmid b\) cannot be dropped in a straightforward way, and the same work derives companion congruences for the alternating sum \(T(a,b)\) of the partial quotients in the continued fraction of \(a/b\) [1609.08282].

A combinatorial reformulation uses inversion numbers. If \(\sigma_a:x\mapsto ax\pmod b\) is the permutation of \(\{1,\dots,b\}\) induced by multiplication by \(a\), then
\[
\operatorname{inv}(a,b)=-3b\,s(a,b)+\frac{(b-1)(b-2)}{4}.
\]
Hence equal Dedekind sums are equivalent to equal inversion numbers, and the inversion polynomial
\[
f_b(x)=\sum_{\gcd(a,b)=1}x^{\operatorname{inv}(a,b)}
\]
packages the multiplicity structure for fixed modulus \(b\) [1411.4092].

## 4. Extremal values and continued-fraction asymptotics

The extremal theory asks which arguments \(m\) make \(s(m,n)\) largest for a fixed modulus \(n\). For a fixed positive integer \(k\), Girstmair proved that for all sufficiently large \(n>k\) with \((k,n)=1\), there is an explicitly described set of residue classes
\[
|S|\le \sum_{d=1}^k \varphi(d)\Bigl\lfloor\frac{k}{d}\Bigr\rfloor=O(k^2)
\]
such that
\[
s(m,n)\ge s(k,n)\quad\Longleftrightarrow\quad m\in S.
\]
These exceptional classes are precisely those that can be written
\[
m=\frac{nc+q}{d},
\qquad
d\in\{1,\dots,k\},\ 
c\in\{0,\dots,d-1\},\ 
\gcd(c,d)=1,\ 
q\in\{1,\dots,\lfloor k/d\rfloor\}.
\]
For \(m\) outside this set, one has \(s(m,n)<s(k,n)\) once \(n\) is sufficiently large [1607.07682].

The proof combines reciprocity with Farey approximation. Reciprocity gives
\[
S(k,n)=\frac{n}{k}+O(1),
\qquad\text{hence}\qquad
s(k,n)=\frac1{12}\frac{n}{k}+O(1).
\]
A Farey-approximation lemma yields, for general \(m\),
\[
S(m,n)=\frac{n}{dq}+O(1),
\]
where \(d\) is a small denominator and \(q=md-nc\). Large values therefore occur only when the product \(dq\) is small. This explains the linear growth of extreme values in \(n\), in contrast with the statement that the average size of \(|s(m,n)|\) grows like \(\log n\) [1607.07682].

Continued fractions govern a second asymptotic regime, namely Dedekind sums evaluated along convergents to a fixed real quadratic irrational \(z\). If \(p_k/q_k\) are the regular convergents and \(s_j/t_j\) the negative-regular convergents, then the normalized sums \(S(p_k,q_k)\) and \(S(s_j,t_j)\) fall into three cases determined by explicit period data. Writing \(B\) and \(D\) for the corresponding period sums, one has:
\[
B>0\ (\text{equivalently }D<3)\Rightarrow S\to +\infty,
\]
\[
B=0\ (\text{equivalently }D=3)\Rightarrow \text{the sequences remain bounded},
\]
\[
B<0\ (\text{equivalently }D>3)\Rightarrow S\to -\infty.
\]
In the bounded case there are finitely many cluster points \(U_h\) and \(V_i\), all pairwise distinct within their respective families, and coincidences between the two families occur exactly at positions with \(d_{i+1}\ge 3\) [1402.5231].

These results place Dedekind sums within the fine periodic combinatorics of continued fractions. The large-value theorem describes extremality for fixed modulus, while the quadratic-irrational theory describes asymptotic patterns along infinite continued-fraction trajectories.

## 5. Recurrence of values and distribution

A striking multiplicity theorem states that every rational value taken by a normalized Dedekind sum recurs infinitely often with unbounded denominators. If \(r=S(a,b)\), then there exists an infinite sequence of coprime pairs \((a_i,b_i)\) with \(b_i\to\infty\) such that
\[
S(a_i,b_i)=r\qquad\forall\,i.
\]
The construction passes from the continued fraction of \(a/b\) to a purely periodic quadratic irrational and then uses a lemma asserting that Dedekind sums of certain convergents are constant along an arithmetic progression of indices [1705.08626].

This theorem does not imply density of denominators. The same source notes that the denominators \(q_k\) produced by the construction grow exponentially in the index, so the achieved denominators are “thin”; in special situations one can do better, but the general density question remains open [1705.08626]. The result nevertheless shows that no rational value of a normalized Dedekind sum can occur only finitely often.

For fixed denominator \(q\), Girstmair studied the numerators \(k\) for which \(k/q\) occurs as a value of \(S(a,b)\). The details state that if
\[
S(a,b)=\frac{k}{q},\qquad \gcd(k,q)=1,
\]
then for every integer \(t\) there exists \((a',b')\) with
\[
S(a',b')=\frac{k+t(q-1)q}{q}.
\]
Thus, once one numerator occurs, the entire residue class modulo \((q-1)q\) occurs as well, reducing the classification problem to finitely many residue classes for each \(q\) [1610.05588].

Computations reported there for \(2\le q\le 50\) identify congruence restrictions on admissible numerators. The details state, for example, that if \(3\nmid q\) then \(k\equiv0\pmod 3\), and that for odd \(q\) there are further congruence conditions modulo \(4\) or \(8\) depending on \(q\bmod 4\) and whether \(q\) is an odd square [1610.05588]. The same paper formulates a conjectural complete classification based on these patterns.

At the level of distribution, Dedekind sums are described as arithmetic sums with values uniformly distributed on the unit interval, and Vardi’s equidistribution theorem is recovered and extended in the setting of Dedekind symbols for lattices [1509.04429]. A combinatorial encoding of fixed-modulus multiplicities is given by the inversion polynomial \(f_b(x)\), whose symmetry
\[
f_b(x)=x^{(b-1)(b-2)/2}f_b(x^{-1})
\]
reflects the relation \(\operatorname{inv}(a,b)+\operatorname{inv}(-a,b)=\frac{(b-1)(b-2)}{2}\) [1411.4092].

## 6. Generalizations: lattices, characters, and higher weight

One major direction replaces \(SL_2(\mathbb Z)\) by a non-cocompact lattice \(\Gamma<SL_2(\mathbb R)\). In this setting Dedekind symbols are defined on double cosets \(\Gamma_\infty\backslash\Gamma/\Gamma_\infty\) using a cocycle extracted from a Kronecker-limit-type function, and they recover the classical Dedekind sum when \(\Gamma=SL_2(\mathbb Z)\) [1509.04429]. These symbols become equidistributed modulo \(1\) as the lower-left entry \(c\) grows, and the proof proceeds by relating exponential sums of Dedekind symbols to Selberg–Kloosterman sums and then applying bounds of Goldfeld–Sarnak [1509.04429].

A cohomological formulation interprets generalized Dedekind sums through the Euler class. Petersson’s cocycle
\[
\omega(g,h)=\frac{\log j(g,hz)+\log j(h,z)-\log j(gh,z)}{2\pi i}
\]
represents the Euler class, and a splitting \(\rho\) of the corresponding central extension yields reciprocity laws for Dedekind symbols attached to arbitrary cofinite Fuchsian groups [1609.03588]. In the case of Hecke triangle groups, this machinery produces an explicit continued-fraction formula analogous to Hickerson’s formula in the classical case [1609.03588]. Survey work emphasizes that such Dedekind symbols also occur for non-arithmetic groups and connect reciprocity to cocycle rigidity and rationality phenomena [1809.03038].

A second major direction is the newform Dedekind sum \(S_{\chi_1,\chi_2}(a,c)\), attached to primitive Dirichlet characters \(\chi_1,\chi_2\) and newform Eisenstein series. Corbett and Young show that these sums are rarely substantially larger than \((\log c)^3\): if
\[
F(\alpha,C)=\#\{1\le a<c\le C,\ (a,c)=1,\ q_1q_2\mid c:\ |S_{\chi_1,\chi_2}(a,c)|>\alpha(\log C)^3\},
\]
then
\[
F(\alpha,C)\ll_{\chi_1,\chi_2} \frac{C^2}{\alpha}+C^2\frac{\log\log C}{\log C}.
\]
At the same time, explicit arithmetic progressions produce values of linear size in \(c\), so the theory displays a sharp contrast between rare extremal behavior and typical polylogarithmic size [2405.00274].

The image of the generalized Dedekind sum also has an arithmetic structure. For primitive characters \(\chi_1,\chi_2\), the newform sum restricts to a genuine group homomorphism
\[
S_{\chi_1,\chi_2}:\Gamma_1(q_1q_2)\longrightarrow F_{\chi_1,\chi_2},
\]
where \(F_{\chi_1,\chi_2}\) is the number field generated by the character values, and its image is a full-rank lattice \(L_{\chi_1,\chi_2}\) [2503.09741]. The paper proves
\[
L_{\chi_1,\chi_2}\subseteq \frac1{\gcd(q_1,q_2)}\,\mathbb Z[\chi_1,\chi_2],
\]
and, in the quadratic case with odd conductors \(q_i>4\), obtains stronger integral containment results. It also records the “Two-Conjecture” that for quadratic characters one should have
\[
L_{\chi_1,\chi_2}=2\mathbb Z.
\]
A generalized version predicts \(L_{\chi_1,\chi_2}=2\,\mathbb Z[\chi_1,\chi_2]\) whenever \(F_{\chi_1,\chi_2}\) is quadratic [2503.09741].

Higher-weight analogues arise from period integrals of holomorphic Eisenstein series attached to character pairs. The resulting sums \(S_{\chi_1,\chi_2,k}\) admit a finite-sum formula involving periodic Bernoulli polynomials \(B_{k-1}\), satisfy a Fricke reciprocity law, and define quantum modular forms of weight \(2-k\) on \(\Gamma_1(q_1q_2)\) [2512.17139]. The same work reports strong divisibility patterns for normalized values \(\widetilde S_{\chi_1,\chi_2,k}(\gamma)=c^{k-2}S_{\chi_1,\chi_2,k}(\gamma)\), with computational evidence in small conductor and weight.

Other generalizations replace the first Bernoulli function by higher Bernoulli, Euler, or poly-Bernoulli data. Borda studies inhomogeneous generalized Dedekind sums
\[
s_{p,q}(a,b)=\sum_{k=1}^{b-1} B_p\!\bigl(\{\tfrac{ak}{b}\}\bigr)\,B_q\!\bigl(\{\tfrac{k}{b}\}\bigr)
\]
and derives asymptotic formulas in terms of the partial quotients of \(a/b\) [1606.07946]. Apostol-type poly-Dedekind sums, as well as poly-Dedekind type DC sums built from poly-Euler functions, retain reciprocity relations of the same general form as the classical theory [2009.04853] [2012.00264].

Across these variants, the recurring structural features are reciprocity, cocycle or modular-symbol interpretations, strong arithmetic constraints on images or values, and continued-fraction control of size. This suggests that the classical Dedekind sum is best understood not as an isolated special function, but as the weight-\(2\), level-\(1\) prototype of a broad reciprocity framework in arithmetic and automorphic theory.

Source: https://www.emergentmind.com/topics/dedekind-sum