2025-11-25T15:01:18.134380

On the decimal digits of $1/p$

Girstmair
Let $p$ be a prime $\equiv 3$ mod 4, $p>3$, and suppose that 10 has the order $(p-1)/2$ mod p. Then $1/p$ has a decimal period of length $(p-1)/2$. We express the frequency of each digit $0,\ldots,9$ in this period in terms of the class numbers of two imaginary quadratic number fields. We also exhibit certain analogues of this result, so for the case that 10 is a primitive root mod $p$ and for octal digits of $1/p$.
academic

On the decimal digits of 1/p1/p

Basic Information

  • Paper ID: 2510.07873
  • Title: On the decimal digits of 1/p1/p
  • Author: Kurt Girstmair (University of Innsbruck)
  • Classification: math.NT (Number Theory)
  • Publication Date: October 28, 2025 (arXiv v4)
  • Paper Link: https://arxiv.org/abs/2510.07873

Abstract

Let pp be a prime satisfying p3(mod4)p \equiv 3 \pmod{4} and p>3p > 3, and assume that the order of 10 modulo pp is (p1)/2(p-1)/2. Then the period length of the decimal expansion of 1/p1/p is (p1)/2(p-1)/2. This paper expresses the frequency of each digit 0,,90, \ldots, 9 in this period using the class numbers of two imaginary quadratic number fields. The article also presents analogous results, including the case where 10 is a primitive root modulo pp and the octal digits of 1/p1/p.

Research Background and Motivation

  1. Problem Background: Since Girstmair first established the connection between the digits of 1/p1/p and class numbers in 1994, numerous studies have emerged in this field. Existing research primarily focuses on the distribution of decimal digits of 1/p1/p or more generally m/pm/p (where mm is a quadratic residue modulo pp).
  2. Problem Significance: Understanding the digit distribution of reciprocals of primes has not only pure mathematical significance but also is closely related to class number theory in algebraic number theory. This connection provides an effective method for computing digit frequencies for large primes.
  3. Existing Limitations: Known results can only provide the average value of digits, namely j=1(p1)/2aj=9(p1)/4+9h1/2\sum_{j=1}^{(p-1)/2} a_j = 9(p-1)/4 + 9h_1/2, where h1h_1 is the class number of the imaginary quadratic field Q(p)\mathbb{Q}(\sqrt{-p}), but cannot determine the specific frequency of each digit.
  4. Research Motivation: This paper aims to precisely determine the frequency of each digit 0,,90, \ldots, 9 in the period and express these frequencies using the class numbers of two imaginary quadratic number fields.

Core Contributions

  1. Main Theorem: Proposes Theorem 1, which provides exact formulas for the frequency of each digit under specific conditions, involving two class numbers h1h_1 and h2h_2.
  2. Extended Results: Provides analogous results for the case where 10 is a primitive root (Theorem 2) and corresponding results for octal digits (Theorem 3).
  3. Computational Advantage: Provides an effective method for computing digit frequencies for large primes (such as those on the order of 101510^{15}), avoiding the difficulties of direct computation.
  4. Theoretical Deepening: First result in the literature involving the digit distribution expressed through two class numbers.

Detailed Methodology

Problem Definition

Given a prime p3(mod4)p \equiv 3 \pmod{4}, p>3p > 3, where the order of 10 modulo pp is (p1)/2(p-1)/2, determine the frequency of each digit in the decimal expansion of m/pm/p (where mm is a quadratic residue).

Core Method

Basic Setup

For the decimal expansion of m/pm/p: m/p=j=1aj10jm/p = \sum_{j=1}^{\infty} a_j 10^{-j}

where aj{0,,9}a_j \in \{0, \ldots, 9\}, and the sequence (a1,,a(p1)/2)(a_1, \ldots, a_{(p-1)/2}) forms the period.

Key Lemmas

Lemma 1: Let θb(k)=b(k)p(bk)pp\theta_b(k) = \frac{b(k)_p - (bk)_p}{p}, then aj=θ10(m10j1)a_j = \theta_{10}(m \cdot 10^{j-1})

Lemma 2: Based on Berndt's results, provides the distribution difference of quadratic residues and non-residues within specific intervals.

Main Theorem

Theorem 1: Under the above setup, for k{0,,9}k \in \{0, \ldots, 9\}:

nk=12((k+1)p10kp10+δk)n_k = \frac{1}{2}\left(\left\lfloor\frac{(k+1)p}{10}\right\rfloor - \left\lfloor\frac{kp}{10}\right\rfloor + \delta_k\right)

n9k=nkδk,k=0,,4n_{9-k} = n_k - \delta_k, \quad k = 0, \ldots, 4

where the values of δk\delta_k depend on pmod8p \bmod 8:

  • If p3(mod8)p \equiv 3 \pmod{8}:
    • δ0=0\delta_0 = 0
    • δ1=δ4=3h1/2h2/4\delta_1 = \delta_4 = 3h_1/2 - h_2/4
    • δ2=δ1\delta_2 = -\delta_1
    • δ3=3h1/2+h2/4\delta_3 = 3h_1/2 + h_2/4
  • If p7(mod8)p \equiv 7 \pmod{8}:
    • δ0=h1h2/2\delta_0 = h_1 - h_2/2
    • δ1=h2/4\delta_1 = h_2/4
    • δ2=3h2/4\delta_2 = 3h_2/4
    • δ3=δ4=δ1\delta_3 = \delta_4 = -\delta_1

Technical Innovations

  1. Interval Analysis Method: By establishing correspondence between digits and integers within specific intervals, transforms the digit frequency problem into a problem of counting quadratic residues within intervals.
  2. Class Number Representation: Utilizes Berndt's profound results to express the distribution difference of quadratic residues through class numbers of imaginary quadratic number fields.
  3. Symmetry Exploitation: Cleverly exploits the duality relationship of quadratic residue properties between plp-l and ll to establish relationships between nkn_k and n9kn_{9-k}.

Experimental Setup

Verification Cases

The paper provides several specific numerical verifications:

  1. p=67p = 67: h1=1h_1 = 1, h2=18h_2 = 18
    • 1/67=0.0149253731343283582089552238805971/67 = 0.\overline{014925373134328358208955223880597}
    • Theoretically predicted frequencies perfectly match actual calculations
  2. p=79p = 79: Demonstrates application in more general cases
    • Involves period analysis of multiple fractions 1/791/79, 9/799/79, 2/792/79
  3. p=47p = 47: Verification of the primitive root case
    • Verifies the correctness of Theorem 2

Theoretical Analysis

  • Under the Generalized Riemann Hypothesis, the density of primes satisfying the conditions is approximately A/2=0.186977A/2 = 0.186977\ldots (where AA is the Artin constant)
  • Approximately 37% of primes p3(mod4)p \equiv 3 \pmod{4} satisfy the condition that the order of 10 is (p1)/2(p-1)/2

Experimental Results

Main Results

  1. Exact Match: All numerical verifications perfectly confirm the correctness of the theoretical formulas
  2. Computational Efficiency: For large primes, computing frequencies using class numbers is significantly faster than direct computation
  3. Distribution Patterns: Reveals intrinsic patterns in digit frequencies, such as n3>n6n_3 > n_6 when p3(mod8)p \equiv 3 \pmod{8}

Extended Results

  1. Primitive Root Case: Theorem 2 addresses the case where 10 is a primitive root, providing different distributions for digits at odd and even positions
  2. Octal Case: Theorem 3 generalizes the results to octal expansion, involving the class number of Q(2p)\mathbb{Q}(\sqrt{-2p})

The paper provides a detailed review of the development history of this field:

  • Girstmair (1994) first established the connection
  • Subsequent research includes work by Hirabayashi, Murty & Thangadurai, Mizuno, and others
  • This paper is the first result involving two class numbers

Conclusions and Discussion

Main Conclusions

  1. Successfully establishes the exact relationship between digit frequencies of 1/p1/p and class numbers of two imaginary quadratic number fields
  2. Provides an effective method for computing digit distributions of large primes
  3. Reveals the deep number-theoretic structure underlying digit distribution

Limitations

  1. Applies only to primes satisfying specific conditions (p3(mod4)p \equiv 3 \pmod{4} and order of 10 is (p1)/2(p-1)/2)
  2. For the case p1(mod4)p \equiv 1 \pmod{4}, although formulas exist, they are difficult to interpret using class numbers
  3. Depends on efficient computation of class numbers

Future Directions

  1. Extension to more general cases of primes
  2. Investigation of analogous results in other bases
  3. Exploration of connections with other algebraic structures such as elliptic curves

In-Depth Evaluation

Strengths

  1. Theoretical Depth: Connects the elementary problem of digit distribution with profound algebraic number theory
  2. Computational Practicality: Provides a practically feasible method for computing digit distributions of large primes
  3. Result Completeness: Not only provides main results but also offers multiple extensions and analogues
  4. Sufficient Verification: Confirms the correctness of the theory through multiple concrete examples

Weaknesses

  1. Limited Scope of Application: Results apply only to primes satisfying specific conditions
  2. Proof Dependencies: Key steps depend on Berndt's profound results; the contribution of this paper is relatively elementary
  3. Generalization Difficulties: Extension to other cases faces technical obstacles

Impact

  1. Academic Value: Provides new perspectives on the connection between digit distribution and class number theory
  2. Computational Significance: Has practical application value in large prime computation
  3. Inspirational Value: May inspire further research in related directions

Application Scenarios

  1. Fast computation of digit distributions for large primes
  2. Application research of class numbers in algebraic number theory
  3. Digital sequence analysis and cryptography-related applications

References

The paper cites 16 related references, primarily including:

  • B.C. Berndt's classical quadratic residue theorems
  • The author's earlier work
  • Recent major advances in this field
  • Related methods for class number computation

This paper is of significant importance in number theory. It not only solves a specific digit distribution problem but, more importantly, reveals the profound connection between elementary number theory and algebraic number theory, providing new tools and perspectives for related research.