pith. sign in

arxiv: 2601.08416 · v3 · pith:WH4EM5MEnew · submitted 2026-01-13 · 🧮 math.NT

On the variance of the digits of 1/p

Pith reviewed 2026-05-21 16:38 UTC · model grok-4.3

classification 🧮 math.NT
keywords digit varianceperiodic digit expansionsDedekind sumsclass numbersBernoulli numbersmultiplicative orderprime reciprocalsbase-b expansions
0
0 comments X

The pith

The variance of digits in the base-b expansion of 1/p for period length (p-1)/2 equals a formula with Dedekind sums, class numbers, or Bernoulli number products.

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

This paper extends a prior formula for the variance of digits in full-period expansions of 1/p to the shorter-period case where the multiplicative order of b modulo p is exactly (p-1)/2. It supplies explicit arithmetic expressions for this variance: a combination of a Dedekind sum and the class number of the quadratic field Q(sqrt(-p)) when p is congruent to 3 modulo 4, and more involved linear combinations of products of Bernoulli numbers attached to odd characters when p is congruent to 1 modulo 4. A sympathetic reader cares because these formulas convert a statistical property of digit sequences into computable number-theoretic quantities, allowing exact evaluation without generating the full digit string. The work stays within the setting of prime denominators and bases coprime to the prime.

Core claim

We determine the variance in the case q=(p-1)/2. If p≡3 mod 4 a Dedekind sum and the class number of Q(√-p) occur in the respective formula. If p≡1 mod 4, the formula may be much more complex since it involves linear combinations of (possibly many) products of two Bernoulli numbers attached to odd characters.

What carries the argument

Variance of the digits appearing in one full period of the base-b expansion of 1/p, expressed through Dedekind sums when p ≡ 3 mod 4 and through Bernoulli numbers of odd characters when p ≡ 1 mod 4.

If this is right

  • For primes congruent to 3 mod 4 the digit variance becomes an explicit arithmetic function of the class number of Q(sqrt(-p)).
  • The variance can be evaluated from number-theoretic data without enumerating or summing the actual digit sequence.
  • When p ≡ 1 mod 4 the variance is a linear combination over products of two Bernoulli numbers belonging to odd characters modulo p.
  • These expressions extend the earlier full-period formula and therefore give a uniform arithmetic description of digit variance for all proper divisors of p-1 that arise as orders.

Where Pith is reading between the lines

These are editorial extensions of the paper, not claims the author makes directly.

  • The same machinery may produce closed forms for higher moments or for the joint distribution of consecutive digits in the same half-period setting.
  • Numerical checks of the variance against the class-number formula could serve as an independent verification route for tabulated class numbers of imaginary quadratic fields.
  • The appearance of odd-character Bernoulli products for p ≡ 1 mod 4 suggests possible links to other character-sum statistics that appear in the study of Artin L-functions or class-number formulas.

Load-bearing premise

The multiplicative order of b modulo p is exactly (p-1)/2 and the usual functional equations plus reciprocity laws for Dedekind sums and character Bernoulli numbers apply directly to the given b and p.

What would settle it

Pick a small prime p ≡ 3 mod 4 such as p=7, choose b whose order modulo 7 is exactly 3, compute the empirical variance of the three digits in the repeating expansion of 1/7 in base b, and check whether the number matches the value predicted by the Dedekind-sum-plus-class-number formula.

read the original abstract

Let $p>3$ be a prime and $b\ge 2$ an integer such that $p$ does not divide $b$. Then $1/p$ has a periodic digit expansion with respect to the basis $b$. The length $q$ of the period is the (multiplicative) order of $b$ mod $p$. In the case $q=p-1$ a formula for the variance of the digits of a period was given previously. This formula involves a Dedekind sum. We determine the variance in the case $q=(p-1)/2$. If $p\equiv 3$ mod 4 a Dedekind sum and the class number of $\mathbb Q(\sqrt{-p})$ occur in the respective formula. If $p\equiv 1$ mod 4, the formula may be much more complex since it involves linear combinations of (possibly many) products of two Bernoulli numbers attached to odd characters.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

2 major / 2 minor

Summary. The paper determines the variance of digits in the base-b periodic expansion of 1/p for prime p>3 when the period length q equals (p-1)/2. For p≡3 mod 4 the formula involves a Dedekind sum s(b,p) together with the class number of Q(√-p); for p≡1 mod 4 it expresses the variance via linear combinations of products of Bernoulli numbers B_{1,χ} attached to odd Dirichlet characters.

Significance. If the derivations hold, the work supplies explicit arithmetic formulas for digit variance in the half-period case, extending earlier results for full-period expansions (q=p-1) and expressing the quantity in terms of classical invariants such as Dedekind sums, class numbers, and character Bernoulli numbers. This could aid further study of equidistribution properties of rational expansions.

major comments (2)
  1. [Derivation of the variance formula (around the substitution step for q=(p-1)/2)] The central derivation selects b with ord_p(b)=(p-1)/2 exactly and substitutes into a general period-sum formula that invokes the reciprocity law for the Dedekind sum s(b,p) and the functional equation for Bernoulli numbers attached to odd characters. No separate verification is given that the reduced order introduces no correction terms arising from the action of the quotient group (Z/pZ)*/<b> or from b^{(p-1)/2}≡1 mod p. This assumption is load-bearing for both the p≡3 mod 4 and p≡1 mod 4 formulas.
  2. [The p≡1 mod 4 case (expression involving products of Bernoulli numbers)] In the p≡1 mod 4 case the expression is written as a linear combination of products B_{1,χ}B_{1,ψ} over odd characters; the manuscript does not check whether only characters trivial on the index-2 subgroup generated by b survive or whether the general identity continues to hold verbatim after the substitution.
minor comments (2)
  1. [Abstract and §1] The abstract and introduction should explicitly recall the earlier formula for the full-period case q=p-1 so that the new half-period formulas can be compared directly.
  2. [Throughout] Notation for the base b and the specific choice of b with exact order (p-1)/2 should be fixed once at the beginning and used consistently; occasional shifts between general b and the restricted b are confusing.

Simulated Author's Rebuttal

2 responses · 0 unresolved

We thank the referee for the careful reading of our manuscript and for the constructive comments on the derivation. We address each major comment below and indicate the revisions we will make to clarify the substitution step and strengthen the presentation.

read point-by-point responses
  1. Referee: [Derivation of the variance formula (around the substitution step for q=(p-1)/2)] The central derivation selects b with ord_p(b)=(p-1)/2 exactly and substitutes into a general period-sum formula that invokes the reciprocity law for the Dedekind sum s(b,p) and the functional equation for Bernoulli numbers attached to odd characters. No separate verification is given that the reduced order introduces no correction terms arising from the action of the quotient group (Z/pZ)*/<b> or from b^{(p-1)/2}≡1 mod p. This assumption is load-bearing for both the p≡3 mod 4 and p≡1 mod 4 formulas.

    Authors: We appreciate the referee highlighting the need for explicit verification at the substitution step. The general period-sum formula is obtained by summing the relevant arithmetic functions (arising from the digit expression) over the cyclic subgroup generated by b of order q=(p-1)/2. Because the digit sequence of 1/p in base b is strictly periodic with this exact period, the sum is taken exclusively over the elements of this subgroup; the quotient group (Z/pZ)*/<b> acts by sending the period to a distinct coset whose contributions are excluded by the choice of b. The condition b^{(p-1)/2}≡1 mod p is precisely the definition of the order being q, so the functional equation and reciprocity law for the Dedekind sum s(b,p) apply directly to this b without extra correction terms. The same reasoning holds for the character sums in the p≡1 mod 4 case. We will insert a short clarifying paragraph immediately after the statement of the general formula (new Section 2.3) that explicitly restricts the summation index to the subgroup <b> and notes the absence of quotient corrections. revision: yes

  2. Referee: [The p≡1 mod 4 case (expression involving products of Bernoulli numbers)] In the p≡1 mod 4 case the expression is written as a linear combination of products B_{1,χ}B_{1,ψ} over odd characters; the manuscript does not check whether only characters trivial on the index-2 subgroup generated by b survive or whether the general identity continues to hold verbatim after the substitution.

    Authors: The referee correctly notes that an explicit check would be helpful. In the derivation we start from the full-group expression for the variance (valid for any b of order dividing p-1) and then restrict the sum to the powers of the chosen b. For odd characters χ,ψ the associated Bernoulli numbers B_{1,χ} are independent of b. When the summation range is reduced to the index-2 subgroup <b>, characters that are non-trivial on <b> contribute zero to the restricted character sum because their partial sums over the subgroup vanish by the order condition. Consequently the linear combination collapses to the stated form without additional factors, and the general identity holds verbatim after substitution. To make this transparent we will add a brief lemma (Lemma 4.2 in the revised manuscript) that computes the restricted sum over characters and confirms that only the appropriate combinations of B_{1,χ}B_{1,ψ} remain. revision: yes

Circularity Check

0 steps flagged

Variance formulas for q=(p-1)/2 expressed via independent number-theoretic invariants

full rationale

The derivation begins from the definition of the periodic digit expansion of 1/p in base b and the period length q as the multiplicative order of b modulo p. For the specific case q=(p-1)/2 the paper substitutes this b into a general period-sum expression and applies the standard reciprocity law for the Dedekind sum s(b,p) together with the functional equations for Bernoulli numbers attached to odd Dirichlet characters. The resulting closed-form expressions involve only these externally defined objects (Dedekind sums, class numbers of Q(√-p), and products B_{1,χ}B_{1,ψ}) whose properties are established independently of the variance quantity under study. No equation equates the variance to a fitted parameter extracted from the same data, nor does any step reduce the claimed formula to a tautology by re-labeling an input as a prediction. The prior result for the full-period case q=p-1 is cited only for context and is not required to justify the new half-period formulas.

Axiom & Free-Parameter Ledger

0 free parameters · 1 axioms · 0 invented entities

The central claim rests on standard properties of Dedekind sums, class numbers of quadratic fields, and Bernoulli numbers attached to characters; no free parameters or new entities are introduced.

axioms (1)
  • standard math Standard functional equations and reciprocity laws for Dedekind sums and Bernoulli numbers attached to odd characters hold.
    These are invoked to obtain the explicit variance formulas in both congruence cases.

pith-pipeline@v0.9.0 · 5688 in / 1301 out tokens · 70900 ms · 2026-05-21T16:38:46.263742+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Reference graph

Works this paper leans on

12 extracted references · 12 canonical work pages

  1. [1]

    Chakraborty, K

    K. Chakraborty, K. Krishnamoorthy, On some symmetries of the basenexpansion of 1/m: the class number connection, Pacific J. Math. 319 (2022), 39–53

  2. [2]

    Girstmair, The digits of 1/pin connection with class number factors, Acta Arith

    K. Girstmair, The digits of 1/pin connection with class number factors, Acta Arith. 67 (1994) 381–386

  3. [3]

    Girstmair, Periodische Dezimalbr¨ uche – was nicht jeder dar¨ uber weiß, Jahrbuch ¨Uberblicke Mathematik 1995, Braunschweig, 1995, 163–179

    K. Girstmair, Periodische Dezimalbr¨ uche – was nicht jeder dar¨ uber weiß, Jahrbuch ¨Uberblicke Mathematik 1995, Braunschweig, 1995, 163–179

  4. [4]

    Girstmair, Digit variance and Dedekind sums, J

    K. Girstmair, Digit variance and Dedekind sums, J. Number Th. 65 (1997), 197–205

  5. [5]

    Hirabayashi, Generalizations of Girstmair’s formula, Abh

    M. Hirabayashi, Generalizations of Girstmair’s formula, Abh. Math. Sem. Univ. Hamburg 75 (2005), 83–95

  6. [6]

    Mizuno, A certain character twisted average value of the digits of rational num- bers and the class numbers of imaginary quadratic fields, Acta Arith

    Y. Mizuno, A certain character twisted average value of the digits of rational num- bers and the class numbers of imaginary quadratic fields, Acta Arith. 208 (2023), 215–233

  7. [7]

    Moree, Near-primitive roots, Funct

    P. Moree, Near-primitive roots, Funct. Approx. Comment. Math. 48 (2013), 133– 145

  8. [8]

    M. R. Murty, R. Thangadurai, The class number ofQ( √−p) and digits of 1/p, Proc. Amer. Math. Soc. 139 (2011), 1277–1289

  9. [9]

    Pujahari, N

    S. Pujahari, N. Saikia,l-adic digits and class numbers of imaginary quadratic fields, Internat. J. Math. 35 (2024), Paper No. 2450041, 16 pp

  10. [10]

    Rademacher, E

    H. Rademacher, E. Grosswald, Dedekind Sums. Mathematical Association of Amer- ica, 1972

  11. [11]

    Shiomi, An analogue of Girstmair’s formula in function fields, Finite Fields Appl

    D. Shiomi, An analogue of Girstmair’s formula in function fields, Finite Fields Appl. 103 (2025), Paper No. 102585, 16 pp

  12. [12]

    Szmidt, J

    J. Szmidt, J. Urbanowicz, D. Zagier, Congruences among generalized Bernoulli num- bers, Acta Arith. 71 (1995), 273–278. 8