Introduction
Conflict-avoiding codes have been investigated as protocol sequences for use in a multiple-access (collision) channel without feedback [14 , 27 , 37 , 23 , 40 ] . For a detailed technical description of this multiple-access channel model, we refer the reader to [3 , 26 ] .
In mathematical terms, the definition is as follows: Given any positive integer n n n , we let Z n \mathbb{Z}_n Z n denote the ring of integers modulo n n n , and let P ( n , k ) \mathcal{P}(n,k) P ( n , k ) represent the set of all k k k -element subsets of Z n \mathbb{Z}_n Z n . Each element x ∈ P ( n , k ) x \in\mathcal{P}(n,k) x ∈ P ( n , k ) can be associated with a binary sequence of length n n n and weight k k k , indicating the positions of the nonzero entries. For a given subset x ∈ P ( n , k ) x \in\mathcal{P}(n,k) x ∈ P ( n , k ) , we define its difference set as follows:
Δ ( x ) : = { a − b ( m o d n ) : a , b ∈ x , a ≠ b } . \Delta(x) := \{a-b \pmod n : a,b \in x,\ a \ne b\}. Δ ( x ) := { a − b ( mod n ) : a , b ∈ x , a = b } .
Note that ∣ Δ ( x ) ∣ ≤ k ( k − 1 ) |\Delta(x)| \le k(k-1) ∣Δ ( x ) ∣ ≤ k ( k − 1 ) , and if i ∈ Δ ( x ) i \in\Delta(x) i ∈ Δ ( x ) , then n − i ∈ Δ ( x ) n-i \in\Delta(x) n − i ∈ Δ ( x ) as well; that is, Δ ( x ) \Delta(x) Δ ( x ) is symmetric with respect to n / 2 n/2 n /2 . A conflict-avoiding code (CAC) of length n n n and weight k k k is defined as a subset C ⊂ P ( n , k ) \mathcal{C} \subset\mathcal{P}(n,k) C ⊂ P ( n , k ) such that for any distinct x , y ∈ C x,y \in\mathcal{C} x , y ∈ C , the intersection Δ ( x ) ∩ Δ ( y ) \Delta(x) \cap\Delta(y) Δ ( x ) ∩ Δ ( y ) is empty. Each element x ∈ C x \in\mathcal{C} x ∈ C is referred to as a codeword of length n n n and weight k k k . Without loss of generality, we can assume that all codewords contain 0 0 0 . For example C = { { 0 , 1 , 6 } , { 0 , 4 , 8 } } \mathcal{C} = \{\{0,1,6\},\{0,4,8\}\} C = {{ 0 , 1 , 6 } , { 0 , 4 , 8 }} is a CAC of length 11 and weight 3, with the codewords corresponding to the binary protocol sequences ( 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 ) (1,1,0,0,0,0,1,0,0,0,0) ( 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 ) , respectively ( 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 ) (1,0,0,0,1,0,0,0,1,0,0) ( 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 ) .
For given n n n and k k k , let CAC ( n , k ) \operatorname{CAC}(n,k) CAC ( n , k ) denote the class of all CACs of length n n n with weight k k k . The maximum possible size of the codes in CAC ( n , k ) \operatorname{CAC}(n,k) CAC ( n , k ) will be denoted by M ( n , k ) M(n,k) M ( n , k ) , i.e.,
M ( n , k ) : = max { ∣ C ∣ : C ∈ CAC ( n , k ) } . M(n,k) := \max\{|C| : C \in\operatorname{CAC}(n,k)\}. M ( n , k ) := max { ∣ C ∣ : C ∈ CAC ( n , k )} .
A code C ∈ CAC ( n , k ) \mathcal{C} \in\operatorname{CAC}(n,k) C ∈ CAC ( n , k ) is said to be optimal , if ∣ C ∣ = M ( n , k ) |\mathcal{C}| = M(n,k) ∣ C ∣ = M ( n , k ) . The above example is optimal in CAC ( 11 , 3 ) \operatorname{CAC}(11,3) CAC ( 11 , 3 ) , that is, M ( 11 , 3 ) = 2 M(11,3) = 2 M ( 11 , 3 ) = 2 (as is easily deduced using the Pigeonhole Principle). Zhang, Lo and Wong [45 ] established several families of optimal strongly conflict-avoiding codes of even length and weight three.
Equi-difference conflict-avoiding codes
A codeword x ∈ P ( n , k ) x \in P(n,k) x ∈ P ( n , k ) is said to be equi-difference (or centered in the case k = 3 k=3 k = 3 ) with generator i ∈ Z n ∖ { 0 } i \in\mathbb{Z}_n \setminus\{0\} i ∈ Z n ∖ { 0 } if it has the form
x = x i = { 0 , i , 2 i , … , ( k − 1 ) i } ( m o d n ) , x=x_i=\{0,i,2i,\ldots,(k-1)i\}\pmod n, x = x i = { 0 , i , 2 i , … , ( k − 1 ) i } ( mod n ) ,
and consists of k k k distinct residues modulo n n n . A code C ⊂ P ( n , k ) \mathcal{C} \subset P(n,k) C ⊂ P ( n , k ) is called an equi-difference conflict-avoiding code if every codeword in C \mathcal{C} C is equi-difference. It is denoted CAC e ( n , k ) \operatorname{CAC}^{\mathrm{e}}(n,k) CAC e ( n , k ) . Note that for an equi-difference codeword x i x_i x i , we have
Δ ( x i ) = { ± j i ( m o d n ) : 1 ≤ j ≤ k − 1 } , \Delta(x_i)=\{\pm ji\pmod n:1\le j\le k-1\}, Δ ( x i ) = { ± j i ( mod n ) : 1 ≤ j ≤ k − 1 } ,
which implies that ∣ Δ ( x i ) ∣ ≤ 2 ( k − 1 ) |\Delta(x_i)|\le2(k-1) ∣Δ ( x i ) ∣ ≤ 2 ( k − 1 ) . A codeword satisfying ∣ Δ ( x i ) ∣ ≤ 2 ( k − 1 ) |\Delta(x_i)|\le2(k-1) ∣Δ ( x i ) ∣ ≤ 2 ( k − 1 ) is said to be exceptional . Moreover, an optimal code C ∈ CAC ( n , k ) \mathcal{C}\in\operatorname{CAC}(n,k) C ∈ CAC ( n , k ) is said to be tight if
⋃ x ∈ C Δ ( x ) = Z n ∖ { 0 } . \bigcup_{x\in\mathcal{C}}\Delta(x)=\mathbb{Z}_n\setminus\{0\}. x ∈ C ⋃ Δ ( x ) = Z n ∖ { 0 } .
The maximum code size in CAC e ( n , k ) \operatorname{CAC}^{\mathrm{e}}(n,k) CAC e ( n , k ) will be denoted by M e ( n , k ) M^{\mathrm{e}}(n,k) M e ( n , k ) , i.e.,
M e ( n , k ) = max { ∣ C ∣ : C ∈ CAC e ( n , k ) } . M^{\mathrm{e}}(n,k)=\max\{|\mathcal{C}|:\mathcal{C}\in\operatorname{CAC}^{\mathrm{e}}(n,k)\}. M e ( n , k ) = max { ∣ C ∣ : C ∈ CAC e ( n , k )} .
For the remainder of this section we take k = 3 k=3 k = 3 . It is easy to verify that a general codeword x x x satisfies
2 ≤ ∣ Δ ( x ) ∣ ≤ 6. 2\le|\Delta(x)|\le6. 2 ≤ ∣Δ ( x ) ∣ ≤ 6.
Moreover, if ∣ Δ ( x ) ∣ = 4 |\Delta(x)|=4 ∣Δ ( x ) ∣ = 4 , then x x x must be an equi-difference codeword. For exceptional codewords, we have:
∣ Δ ( x ) ∣ = 2 |\Delta(x)|=2 ∣Δ ( x ) ∣ = 2 if and only if 3 ∣ n 3\mid n 3 ∣ n and x = { 0 , n / 3 , 2 n / 3 } x=\{0,n/3,2n/3\} x = { 0 , n /3 , 2 n /3 } ,
∣ Δ ( x ) ∣ = 3 |\Delta(x)|=3 ∣Δ ( x ) ∣ = 3 if and only if 4 ∣ n 4\mid n 4 ∣ n and x = { 0 , n / 4 , n / 2 } x=\{0,n/4,n/2\} x = { 0 , n /4 , n /2 } ,
and both of these are also equi-difference.
A graph associated to CACn3
For simplicity of notation, we write CAC ( n ) \operatorname{CAC}(n) CAC ( n ) and M ( n ) M(n) M ( n ) instead of CAC ( n , 3 ) \operatorname{CAC}(n,3) CAC ( n , 3 ) , respectively M ( n , 3 ) M(n,3) M ( n , 3 ) . Likewise, we denote CAC e ( n , 3 ) \operatorname{CAC}^{\mathrm{e}}(n,3) CAC e ( n , 3 ) and M e ( n , 3 ) M^{\mathrm{e}}(n,3) M e ( n , 3 ) by CAC e ( n ) \operatorname{CAC}^{\mathrm{e}}(n) CAC e ( n ) , respectively M e ( n ) M^{\mathrm{e}}(n) M e ( n ) . Following Momihara [29 ] we now define a graph G n G_n G n connected with equi-difference codewords. A closely related graph-theoretic description is also used by Mishima and Momihara [28 ] in their construction of a new family of optimal tight conflict-avoiding codes.
Definition 1. Given an odd natural number n n n , define a graph G n = ( V , E ) G_n=(V,E) G n = ( V , E ) as follows:
V = { 1 , 2 , … , ( n − 1 ) / 2 } . V=\{1,2,\ldots,(n-1)/2\}. V = { 1 , 2 , … , ( n − 1 ) /2 } . b ≡ ± 2 a ( m o d n ) . b\equiv\pm2a\pmod n. b ≡ ± 2 a ( mod n ) .
A vertex i ∈ V ( G n ) i\in V(G_n) i ∈ V ( G n ) can be viewed as representing the difference ± i \pm i ± i , and thus, an edge ( a , b ) (a,b) ( a , b ) corresponds to the equi-difference codeword 0 , a , 2 a 0,a,2a 0 , a , 2 a . A loop in G n G_n G n represents the special equi-difference codeword 0 , n / 3 , 2 n / 3 0,n/3,2n/3 0 , n /3 , 2 n /3 , which arises only when 3 ∣ n 3\mid n 3 ∣ n . The graph G n G_n G n decomposes as a collection of disjoint cycles. This follows from the fact that the edge condition defines a permutation on the vertex set V V V . By identifying x x x and − x -x − x , the set V V V represents the non-zero elements of Z n \mathbb{Z}_n Z n up to sign. The edge condition b ≡ ± 2 a ( m o d n ) b\equiv\pm2a\pmod n b ≡ ± 2 a ( mod n ) acts as multiplication by 2 2 2 in this quotient space. Since by assumption n n n is odd, the number 2 2 2 is invertible modulo n n n . Consequently, the mapping a ↦ ± 2 a ( m o d n ) a\mapsto\pm2a\pmod n a ↦ ± 2 a ( mod n ) is a bijection, guaranteeing that every vertex in G n G_n G n has an in-degree and out-degree of exactly 1 1 1 . Equivalently, the reachability between vertices can be formalized by the relation a ∼ b a\sim b a ∼ b if and only if b ≡ ± 2 r a ( m o d n ) b\equiv\pm2^r a\pmod n b ≡ ± 2 r a ( mod n ) for some integer r r r . Because 2 2 2 is invertible in Z n \mathbb{Z}_n Z n , this satisfies the properties of an equivalence relation. The resulting equivalence classes partition V V V into distinct connected components, which strictly correspond to the disjoint cycles of the graph.
Definition 2. Given any odd natural number n n n , we let O ( n ) \mathcal{O}(n) O ( n ) denote the number of cycles of odd length in G n G_n G n , where a loop is considered a cycle of length 1 1 1 . For convenience, we put O ( 1 ) = 0 \mathcal{O}(1)=0 O ( 1 ) = 0 .
For example, G 21 G_{21} G 21 has three cycles: ( 7 ) (7) ( 7 ) , ( 3 , 6 , 9 ) (3,6,9) ( 3 , 6 , 9 ) , and ( 1 , 2 , 4 , 8 , 5 , 10 ) (1,2,4,8,5,10) ( 1 , 2 , 4 , 8 , 5 , 10 ) , and hence O ( 21 ) = 2 \mathcal{O}(21)=2 O ( 21 ) = 2 . The cycle ( 7 ) (7) ( 7 ) is considered a loop.
Recall that for any two distinct codewords x ≠ y x\ne y x = y , the condition Δ ( x ) ∩ Δ ( y ) = ∅ \Delta(x)\cap\Delta(y)=\varnothing Δ ( x ) ∩ Δ ( y ) = ∅ must be satisfied. To construct as many codewords as possible, we aim to maximize the number of disjoint vertex subsets, where each vertex subset S S S falls into one of the following three categories:
(a) ∣ S ∣ = 1 |S|=1 ∣ S ∣ = 1 : the induced subgraph is a loop,
(b) ∣ S ∣ = 2 |S|=2 ∣ S ∣ = 2 : the induced subgraph is a single edge,
(c) S = { a , b , c } S=\{a,b,c\} S = { a , b , c } such that a + b ≡ ± c ( m o d n ) a+b\equiv\pm c\pmod n a + b ≡ ± c ( mod n ) .
Note that for any odd integer n n n , the graph G n G_n G n contains at most one loop. Since each equi-difference codeword corresponds to an edge in G n G_n G n , constructing an optimal code C ∈ C A C e ( n ) C\in\mathrm{CAC}^{e}(n) C ∈ CAC e ( n ) amounts to finding a maximal matching in G n G_n G n , excluding the loop (recall that a matching M M M in a graph G = ( V , E ) G=(V,E) G = ( V , E ) is a subset of the edge set E E E such that no two distinct edges in M M M share a common vertex). Moreover, since each vertex i ∈ V ( G n ) i\in V(G_n) i ∈ V ( G n ) represents the difference ± i \pm i ± i , a tight equi-difference code C ∈ C A C e ( n ) C\in\mathrm{CAC}^{e}(n) C ∈ CAC e ( n ) exists if and only if there is a matching that covers all vertices of G n G_n G n . Given that G n G_n G n is a disjoint union of cycles, such a matching is possible if and only if every cycle has even length. As a consequence, we obtain the following proposition.
Proposition 1. [10 Prop. 1] Given an odd integer n ≥ 3 n\ge3 n ≥ 3 , a tight equi-difference code C ∈ C A C e ( n ) C\in\mathrm{CAC}^{e}(n) C ∈ CAC e ( n ) exists if and only if 3 ∤ n 3\nmid n 3 ∤ n and O ( n ) = 0 \mathcal{O}(n)=0 O ( n ) = 0 , or 3 ∣ n 3\mid n 3 ∣ n and O ( n ) = 1 \mathcal{O}(n)=1 O ( n ) = 1 .
The reader might wonder why the 3 3 3 divisibility of n n n plays a role. This is due to the existence of the special equi-difference codeword ( 0 , n / 3 , 2 n / 3 ) (0,n/3,2n/3) ( 0 , n /3 , 2 n /3 ) which of course only occurs if 3 ∣ n 3\mid n 3 ∣ n .
Making use of some existing results it is not difficult to quantify Proposition 1 (for a proof see § 10 ). The big oh notation for the error terms is explained in any book on analytic number theory, for example in that of Apostol [2 p. 53] . The notation O \mathcal{O} O is in this paper solely used for the quantity defined in Definition 2.
Theorem 1. Let P ( x ) P(x) P ( x ) and N ( x ) N(x) N ( x ) denote the number of primes, respectively odd integers 1 ≤ n ≤ x 1\le n\le x 1 ≤ n ≤ x , for which a tight equi-difference code of length n n n exists. We have
P ( x ) = 5 12 x log x + O ( x log log x ( log x ) 7 / 6 ) and N ( x ) = C x ( log x ) 7 / 12 + O ( x ( log log x ) 5 ( log x ) 19 / 12 ) . P(x)=\frac{5}{12}\frac{x}{\log x}+\mathcal{O}\left(\frac{x\log\log x}{(\log x)^{7/6}}\right)
\quad\text{and}\quad
N(x)=C\frac{x}{(\log x)^{7/12}}+\mathcal{O}\left(\frac{x(\log\log x)^5}{(\log x)^{19/12}}\right). P ( x ) = 12 5 log x x + O ( ( log x ) 7/6 x log log x ) and N ( x ) = C ( log x ) 7/12 x + O ( ( log x ) 19/12 x ( log log x ) 5 ) . with C C C a positive constant. More precisely, if C 0 C_0 C 0 denotes the constant appearing in Theorem 5, then C = 4 3 C 0 ≈ 0.4298 … C=\frac{4}{3}C_0\approx0.4298\ldots C = 3 4 C 0 ≈ 0.4298 … .
More generally, Proposition 1 makes clear the importance of understanding which values are assumed by O ( n ) \mathcal{O}(n) O ( n ) and for how many odd integers 1 ≤ n ≤ x 1\le n\le x 1 ≤ n ≤ x they get assumed as x x x gets large. This is a delicate question that we intend to discuss in greater depth in a future paper. Here we present some alternative interpretations of O ( n ) \mathcal{O}(n) O ( n ) and study O ( p ) \mathcal{O}(p) O ( p ) in detail as p p p runs through the primes, something that also has a coding theoretic relevance, as becomes particularly clear in § 8 . The techniques used will come mainly from the analytic and algebraic number theory used to deal with variations of Artin’s primitive root conjecture. A good inkling of the mathematics involved can be obtained from the survey [33 ] . Many results in this area, also in this paper, will be under the Generalized Riemann Hypothesis (GRH), by which we mean that each Dedekind zeta-function has only non-trivial zeros on the half-line ℜ ( s ) = 1 / 2 \Re(s)=1/2 ℜ ( s ) = 1/2 . Indeed, typically this assumption is only required for the Dedekind zeta-functions of the number fields involved in the proof of the result.
Description of the main results
Before turning to the distributional questions, we first develop several complementary descriptions of the quantity O ( n ) \mathcal{O}(n) O ( n ) . We recall the formula of Fu, Lo and Shum [10 ] in terms of ord d ( 2 ) \operatorname{ord}_{d}(2) ord d ( 2 ) and derive an equivalent formulation using ord d ( 4 ) \operatorname{ord}_{d}(4) ord d ( 4 ) . In particular, for an odd prime p p p , this gives a particularly simple description of O ( p ) \mathcal{O}(p) O ( p ) in terms of the index of 4 4 4 modulo p p p . This description also admits a group-theoretic interpretation. Introducing the graph H p H_p H p , whose vertices are the non-zero squares modulo p p p and whose edges are induced by multiplication by 4 4 4 , we show that H p H_p H p is isomorphic to G p G_p G p . Consequently, whenever O ( p ) > 0 \mathcal{O}(p)>0 O ( p ) > 0 ,
O ( p ) = [ ( F p × ) 2 : ⟨ 4 ⟩ ] = [ F p × : ⟨ − 1 , 2 ⟩ ] . \mathcal{O}(p)=[(\mathbb{F}_p^\times)^2:\langle4\rangle]=[\mathbb{F}_p^\times:\langle-1,2\rangle]. O ( p ) = [( F p × ) 2 : ⟨ 4 ⟩] = [ F p × : ⟨ − 1 , 2 ⟩] .
This also gives a short reproof of a result of Fu, Lo and Shum [10 ] .
A different interpretation of O ( n ) \mathcal{O}(n) O ( n ) is obtained through the factorization of x n − 1 x^n-1 x n − 1 over F 2 \mathbb{F}_2 F 2 . More precisely, O ( n ) \mathcal{O}(n) O ( n ) can be recovered by counting certain pairs of distinct reciprocal irreducible factors of odd degree together with self-reciprocal irreducible factors whose degrees are congruent to 2 2 2 modulo 4 4 4 . This interpretation recovers the preceding order formulas and also leads to the characterization of Wu and Fu [44 ] in case the length of the code is a number of the form 2 e ± 1 2^e\pm1 2 e ± 1 .
Finally, by viewing multiplication by a a a as an automorphism of the additive group Z m \mathbb{Z}_m Z m , we use the Cauchy–Frobenius identity to obtain an explicit formula for the number of odd-length orbits of a general multiplication map. Specializing this description to multiplication by 2 2 2 yields another formula for O ( n ) \mathcal{O}(n) O ( n ) .
In the remaining part of the section we describe our analytic number theory results.
Results on the distribution of O ( p ) \mathcal{O}(p) O ( p ) for prime p p p
Let k ≥ 0 k\geq0 k ≥ 0 be an integer. Put
P k : = { p > 2 : O ( p ) = k } . \mathcal{P}_k:=\{p>2:\mathcal{O}(p)=k\}. P k := { p > 2 : O ( p ) = k } .
and let P k ( x ) \mathcal{P}_k(x) P k ( x ) denote the number of primes p ≤ x p\leq x p ≤ x in P k \mathcal{P}_k P k . The counting function P 0 ( x ) \mathcal{P}_0(x) P 0 ( x ) satisfies, by Proposition 1, the same asymptotic as that given for P ( x ) \mathcal{P}(x) P ( x ) in Theorem 1.
Theorem 2 (under GRH). Let k ≥ 1 k\geq1 k ≥ 1 be an integer. The set of primes P k \mathcal{P}_k P k has a natural density δ k \delta_k δ k given by
δ k = A ⋅ E ( k ) ⋅ { 1 if k is odd ; 0 if k ≡ 2 ( m o d 4 ) ; 2 / 3 if 4 ∣ k , \delta_k=A\cdot E(k)\cdot
\begin{cases}
1 & \text{if } k \text{ is odd};\\
0 & \text{if } k\equiv2\pmod{4};\\
2/3 & \text{if } 4\mid k,
\end{cases} δ k = A ⋅ E ( k ) ⋅ ⎩ ⎨ ⎧ 1 0 2/3 if k is odd ; if k ≡ 2 ( mod 4 ) ; if 4 ∣ k , with
A : = ∏ prime q ( 1 − 1 q ( q − 1 ) ) = 0.3739558136192022880547280543464 … , A:=\prod_{\text{prime }q}\left(1-\frac{1}{q(q-1)}\right)=0.3739558136192022880547280543464\ldots, A := prime q ∏ ( 1 − q ( q − 1 ) 1 ) = 0.3739558136192022880547280543464 … , the Artin constant and
E ( k ) : = 1 k 2 ∏ q ∣ k q 2 − 1 q 2 − q − 1 . (1) E(k):=\frac{1}{k^2}\prod_{q\mid k}\frac{q^2-1}{q^2-q-1}. \tag*{(1)} E ( k ) := k 2 1 q ∣ k ∏ q 2 − q − 1 q 2 − 1 . (1)
Moreover, asymptotically in x x x ,
P k ( x ) = δ k x log x + O k ( x log log x log 2 x ) . P_k(x)=\delta_k\frac{x}{\log x}+O_k\left(\frac{x\log\log x}{\log^2 x}\right). P k ( x ) = δ k log x x + O k ( log 2 x x log log x ) .
In case k ≡ 2 ( m o d 4 ) k\equiv2\pmod{4} k ≡ 2 ( mod 4 ) , we have P k ( x ) = 0 P_k(x)=0 P k ( x ) = 0 .
The techniques used to deal with P k P_k P k can also be used to study the level sets of O ( p ) \mathcal{O}(p) O ( p ) within a prescribed arithmetic progression. For coprime positive integers a a a and d d d , put
P k ( a , d ) ( x ) : = # { p ≤ x : p ≡ a ( m o d d ) , O ( p ) = k } . P_k(a,d)(x):=\#\{p\le x:p\equiv a\pmod d,\ \mathcal{O}(p)=k\}. P k ( a , d ) ( x ) := # { p ≤ x : p ≡ a ( mod d ) , O ( p ) = k } .
For k ≥ 1 k\ge1 k ≥ 1 , Theorem 11 gives, under GRH, an asymptotic formula for P k ( a , d ) ( x ) P_k(a,d)(x) P k ( a , d ) ( x ) . The cases k = 0 k=0 k = 0 and k = 1 k=1 k = 1 admit particularly explicit descriptions. For k = 0 k=0 k = 0 the result is unconditional and the corresponding rational density is described explicitly in Theorem 12 . For k = 1 k=1 k = 1 , we obtain the following more explicit result.
Theorem 3. Let a a a and d d d be coprime positive integers. Under GRH, we have
P 1 ( a , d ) ( x ) = ρ ( d , a ) φ ( d ) x log x + O d ( x log log x ( log x ) 2 ) . (2) P_1(a,d)(x)=\frac{\rho(d,a)}{\varphi(d)}\frac{x}{\log x}+O_d\left(\frac{x\log\log x}{(\log x)^2}\right). \tag*{(2)} P 1 ( a , d ) ( x ) = φ ( d ) ρ ( d , a ) log x x + O d ( ( log x ) 2 x log log x ) . (2) with
ρ ( d , a ) = c ( d , a ) R ( d , a ) A , \rho(d,a)=c(d,a)R(d,a)A, ρ ( d , a ) = c ( d , a ) R ( d , a ) A , where
R ( d , a ) : = 2 ∏ p ∣ ( a − 1 , d ) ( 1 − 1 p ) ∏ p ∣ d ( 1 + 1 p 2 − p − 1 ) , R(d,a):=2\prod_{p\mid(a-1,d)}\left(1-\frac{1}{p}\right)\prod_{p\mid d}\left(1+\frac{1}{p^2-p-1}\right), R ( d , a ) := 2 p ∣ ( a − 1 , d ) ∏ ( 1 − p 1 ) p ∣ d ∏ ( 1 + p 2 − p − 1 1 ) , and
c ( d , a ) : = { 1 / 2 if 4 ∤ d ; 1 if 4 ∣ d , a ≡ 3 ( m o d 4 ) ; 0 if 4 ∣ d , a ≡ 1 ( m o d 4 ) . c(d,a):=
\begin{cases}
1/2 & \text{if }4\nmid d;\\
1 & \text{if }4\mid d,\ a\equiv3\pmod4;\\
0 & \text{if }4\mid d,\ a\equiv1\pmod4.
\end{cases} c ( d , a ) := ⎩ ⎨ ⎧ 1/2 1 0 if 4 ∤ d ; if 4 ∣ d , a ≡ 3 ( mod 4 ) ; if 4 ∣ d , a ≡ 1 ( mod 4 ) .
Our distribution result for O ( p ) \mathcal{O}(p) O ( p ) also has a direct application to the determination of the optimal size of conflict-avoiding codes of prime length. If O ( p ) > 0 \mathcal{O}(p)>0 O ( p ) > 0 , then
M e ( p ) ≤ M ( p ) ≤ M e ( p ) + ⌊ O ( p ) 3 ⌋ , (3) M^e(p)\le M(p)\le M^e(p)+\left\lfloor\frac{\mathcal{O}(p)}{3}\right\rfloor, \tag*{(3)} M e ( p ) ≤ M ( p ) ≤ M e ( p ) + ⌊ 3 O ( p ) ⌋ , (3)
as will be explained in § 3 . A result of Hsia, Li and Sun [17 ] shows that the upper bound is attained when the index O ( p ) \mathcal{O}(p) O ( p ) is an odd prime. Combining their result with Theorem 2 gives the following consequence.
Theorem 4. Let p p p be an odd prime such that O ( p ) \mathcal{O}(p) O ( p ) is an odd prime. Then the upper bound in (3) is attained, and hence
M ( p ) = M e ( p ) + ⌊ O ( p ) 3 ⌋ = p − 1 4 − O ( p ) 2 + ⌊ O ( p ) 3 ⌋ . M(p)=M^e(p)+\left\lfloor\frac{\mathcal{O}(p)}{3}\right\rfloor=\frac{p-1}{4}-\frac{\mathcal{O}(p)}{2}+\left\lfloor\frac{\mathcal{O}(p)}{3}\right\rfloor. M ( p ) = M e ( p ) + ⌊ 3 O ( p ) ⌋ = 4 p − 1 − 2 O ( p ) + ⌊ 3 O ( p ) ⌋ . Moreover, assuming GRH, the set of such primes has relative density 0.508822711238 … 0.508822711238\ldots 0.508822711238 … within the set of odd primes p p p satisfying O ( p ) > 2 \mathcal{O}(p)>2 O ( p ) > 2 .
Result on the distribution of O ( n ) \mathcal{O}(n) O ( n ) for integer n n n
Given any integer e ≥ 0 e \ge0 e ≥ 0 , one can wonder if there are n n n with O ( n ) = e \mathcal{O}(n) = e O ( n ) = e and if they exist, how frequent they are. The following result gives a partial answer (for a proof see § 9 ).
Theorem 5. For x ≥ 3 x \ge3 x ≥ 3 and e ≥ 0 e \ge0 e ≥ 0 , let
N e ( x ) : = # { 1 < m ≤ x : m odd and O ( m ) = e } . N_e(x) := \#\{1 < m \le x : m\ \text{odd and }\mathcal{O}(m) = e\}. N e ( x ) := # { 1 < m ≤ x : m odd and O ( m ) = e } . We have
N 0 ( x ) = C 0 x ( log x ) 7 / 12 + O ( x ( log log x ) 5 ( log x ) 19 / 12 ) , N_0(x) = C_0 \frac{x}{(\log x)^{7/12}} + O\left(\frac{x(\log\log x)^5}{(\log x)^{19/12}}\right), N 0 ( x ) = C 0 ( log x ) 7/12 x + O ( ( log x ) 19/12 x ( log log x ) 5 ) , with
C 0 = 1 Γ ( 5 12 ) lim t → ∞ ∏ p ≤ t g ( p ) ( 1 − 1 p ) 5 / 12 = 0.32235 … , C_0 = \frac{1}{\Gamma\left(\frac{5}{12}\right)}\lim_{t\to\infty}\prod_{p\le t}g(p)\left(1-\frac{1}{p}\right)^{5/12} = 0.32235\ldots, C 0 = Γ ( 12 5 ) 1 t → ∞ lim p ≤ t ∏ g ( p ) ( 1 − p 1 ) 5/12 = 0.32235 … , and g ( p ) = ( 1 − 1 / p ) − 1 g(p) = (1 - 1/p)^{-1} g ( p ) = ( 1 − 1/ p ) − 1 if 2 ∣ ord p ( 4 ) 2 \mid\operatorname{ord}_p(4) 2 ∣ ord p ( 4 ) and g ( p ) = 1 g(p) = 1 g ( p ) = 1 otherwise. For every fixed e ≥ 1 e \ge1 e ≥ 1 and for sufficiently large x x x , we have
N e ( x ) ≫ e x ( log x ) 7 / 12 . N_e(x) \gg_e \frac{x}{(\log x)^{7/12}}. N e ( x ) ≫ e ( log x ) 7/12 x . Using Artin primitive root techniques one can say rather more in case e ≥ 1 e \ge1 e ≥ 1 . We hope to come back to this issue in a future publication.
Organization of the paper
Sections 2–4 develop order-theoretic, graph-theoretic, polynomial, and orbit-counting descriptions of O ( n ) \mathcal{O}(n) O ( n ) , recovering several earlier results along the way. § 5 introduces the near-primitive-root framework and some preliminary density computations. § 6 applies these tools to prove Theorem 2. § 7 studies the distribution of O ( p ) \mathcal{O}(p) O ( p ) in arithmetic progressions and proves Theorem 3. § 8 considers prime values of O ( p ) \mathcal{O}(p) O ( p ) and proves Theorem 4, while § 9 treats the distribution of O ( n ) \mathcal{O}(n) O ( n ) over odd integers and proves Theorem 5. Finally, § 10 proves Theorem 1.
We begin by recalling a formula of Fu, Lo and Shum for the number of odd cycles in G n G_n G n . We then give an equivalent formulation (Proposition 2), involving only the multiplicative order of 4 4 4 , which will be particularly convenient in the subsequent sections.
Definition 3 (order and index). Let a ∈ Q × a \in\mathbb{Q}^{\times} a ∈ Q × and n ≥ 2 n \ge2 n ≥ 2 . Assume that ν p ( a ) = 0 \nu_p(a) = 0 ν p ( a ) = 0 for every prime p ∣ n p \mid n p ∣ n ; equivalently, if a = r / s a = r/s a = r / s is written in lowest terms, then gcd ( r s , n ) = 1 \gcd(rs,n) = 1 g cd( r s , n ) = 1 . The reduction of a a a modulo n n n is then the element a ˉ : = r s − 1 ∈ ( Z n ) × \bar{a} := rs^{-1} \in(\mathbb{Z}_n)^{\times} a ˉ := r s − 1 ∈ ( Z n ) × . Then the smallest integer k ≥ 1 k \ge1 k ≥ 1 such that a ˉ k ≡ 1 ( m o d n ) \bar{a}^{k} \equiv1 \pmod n a ˉ k ≡ 1 ( mod n ) is called the multiplicative order of a a a modulo n n n and denoted by ord n ( a ) \operatorname{ord}_n(a) ord n ( a ) . Differently phrased it is the order of the subgroup ⟨ a ˉ ⟩ \langle\bar{a}\rangle ⟨ a ˉ ⟩ generated by a ˉ \bar{a} a ˉ in Z n × \mathbb{Z}_n^{\times} Z n × . The index of that subgroup is denoted by ind n ( a ) \operatorname{ind}_n(a) ind n ( a ) and called the index of a a a in Z n × \mathbb{Z}_n^{\times} Z n × . We have
ind n ( a ) = φ ( n ) ord n ( a ) . \operatorname{ind}_n(a) = \frac{\varphi(n)}{\operatorname{ord}_n(a)}. ind n ( a ) = ord n ( a ) φ ( n ) . If space allows it, we prefer to write out the expression for the index in terms of the order.
Theorem 6 (Theorem 1 of [10 ] ). For odd n ≥ 3 n \ge3 n ≥ 3 , we have
O ( n ) = ∑ d ∣ n δ d , (4) \mathcal{O}(n) = \sum_{d\mid n}\delta_d, \tag*{(4)} O ( n ) = d ∣ n ∑ δ d , (4)
where
δ d = { 1 2 ind d ( 2 ) if ord d ( 2 ) is odd and > 1 ; ind d ( 2 ) if ord d ( 2 ) ≡ 2 ( m o d 4 ) , 2 ord d ( 2 ) / 2 ≡ − 1 ( m o d d ) ; 0 otherwise. \delta_d =
\begin{cases}
\frac{1}{2}\operatorname{ind}_d(2) & \text{if } \operatorname{ord}_d(2) \text{ is odd and } >1;\\
\operatorname{ind}_d(2) & \text{if } \operatorname{ord}_d(2) \equiv2 \pmod{4},\ 2^{\operatorname{ord}_d(2)/2} \equiv-1 \pmod{d};\\
0 & \text{otherwise.}
\end{cases} δ d = ⎩ ⎨ ⎧ 2 1 ind d ( 2 ) ind d ( 2 ) 0 if ord d ( 2 ) is odd and > 1 ; if ord d ( 2 ) ≡ 2 ( mod 4 ) , 2 ord d ( 2 ) /2 ≡ − 1 ( mod d ) ; otherwise.
The next proposition is a variant of Theorem 6 involving only ord d ( 4 ) \operatorname{ord}_d(4) ord d ( 4 ) , rather than ord d ( 2 ) \operatorname{ord}_d(2) ord d ( 2 ) .
Proposition 2. For every odd integer n ≥ 3 n \ge3 n ≥ 3 , we have
O ( n ) = ∑ d ∣ n , d > 1 2 ∣ ord d ( 4 ) 2 ord d ( 4 ) ≡ ± 1 ( m o d d ) φ ( d ) 2 ord d ( 4 ) . (5) O(n)=\sum_{\substack{d\mid n,\ d>1\\ 2\mid\operatorname{ord}_d(4)\\ 2^{\operatorname{ord}_d(4)}\equiv\pm1\pmod d}}\frac{\varphi(d)}{2\operatorname{ord}_d(4)}. \tag*{(5)} O ( n ) = d ∣ n , d > 1 2 ∣ ord d ( 4 ) 2 ord d ( 4 ) ≡ ± 1 ( mod d ) ∑ 2 ord d ( 4 ) φ ( d ) . (5)
Proof. Identify the vertices of G n G_n G n with the nonzero residue classes modulo n n n , up to sign. For each divisor d > 1 d>1 d > 1 of n n n , let
Ω n ( d ) : = { [ a ] ∈ ( Z n ∖ { 0 } ) / { ± 1 } : n gcd ( a , n ) = d } . \Omega_n(d):=\left\{[a]\in(\mathbb{Z}_n\setminus\{0\})/\{\pm1\}:\frac{n}{\gcd(a,n)}=d\right\}. Ω n ( d ) := { [ a ] ∈ ( Z n ∖ { 0 }) / { ± 1 } : g cd( a , n ) n = d } .
The set Ω n ( d ) \Omega_n(d) Ω n ( d ) has φ ( d ) / 2 \varphi(d)/2 φ ( d ) /2 elements and is invariant under the map [ a ] ↦ [ 2 a ] [a]\mapsto[2a] [ a ] ↦ [ 2 a ] . Every cycle contained in Ω n ( d ) \Omega_n(d) Ω n ( d ) has length s d : = min { r ≥ 1 : 2 r ≡ ± 1 ( m o d d ) } s_d:=\min\{r\ge1:2^r\equiv\pm1\pmod d\} s d := min { r ≥ 1 : 2 r ≡ ± 1 ( mod d )} . Put q d = ord d ( 4 ) q_d=\operatorname{ord}_d(4) q d = ord d ( 4 ) . Since 4 q d ≡ 1 ( m o d d ) 4^{q_d}\equiv1\pmod d 4 q d ≡ 1 ( mod d ) , we have 2 2 q d ≡ 1 ( m o d d ) 2^{2q_d}\equiv1\pmod d 2 2 q d ≡ 1 ( mod d ) , and hence s d ∣ 2 q d s_d\mid2q_d s d ∣ 2 q d . Conversely, if 2 r ≡ ± 1 ( m o d d ) 2^r\equiv\pm1\pmod d 2 r ≡ ± 1 ( mod d ) , then 4 r ≡ 1 ( m o d d ) 4^r\equiv1\pmod d 4 r ≡ 1 ( mod d ) ; therefore q d ∣ r q_d\mid r q d ∣ r . It follows that
s d = { q d , if 2 q d ≡ ± 1 ( m o d d ) , 2 q d , otherwise. s_d=
\begin{cases}
q_d, & \text{if }2^{q_d}\equiv\pm1\pmod d,\\
2q_d, & \text{otherwise.}
\end{cases} s d = { q d , 2 q d , if 2 q d ≡ ± 1 ( mod d ) , otherwise.
Consequently, the cycles contained in Ω n ( d ) \Omega_n(d) Ω n ( d ) have odd length if and only if q d q_d q d is odd and 2 q d ≡ ± 1 ( m o d d ) 2^{q_d}\equiv\pm1\pmod d 2 q d ≡ ± 1 ( mod d ) . When these conditions hold, Ω n ( d ) \Omega_n(d) Ω n ( d ) consists of
∣ Ω n ( d ) ∣ q d = φ ( d ) 2 q d \frac{|\Omega_n(d)|}{q_d}=\frac{\varphi(d)}{2q_d} q d ∣ Ω n ( d ) ∣ = 2 q d φ ( d )
odd cycles. Summing over the divisors d > 1 d>1 d > 1 of n n n , we obtain (5) . □
Remark 1. The congruence condition in (5) is not redundant for composite d d d , since the congruence x 2 ≡ 1 ( m o d d ) x^2\equiv1\pmod d x 2 ≡ 1 ( mod d ) may have solutions other than x ≡ ± 1 ( m o d d ) x\equiv\pm1\pmod d x ≡ ± 1 ( mod d ) . When d = p d=p d = p is an odd prime, however, the condition is automatic. Thus
O ( p ) = { 1 2 ind p ( 4 ) , if ord p ( 4 ) is odd ; 0 , otherwise. O(p)=
\begin{cases}
\frac{1}{2}\operatorname{ind}_p(4), & \text{if }\operatorname{ord}_p(4)\text{ is odd};\\
0, & \text{otherwise.}
\end{cases} O ( p ) = { 2 1 ind p ( 4 ) , 0 , if ord p ( 4 ) is odd ; otherwise.
The graph-theoretic meaning of this prime-length specialization will be developed in the next section.
A new interpretation of Op through a graph equivalent of Gp
We introduce a graph that is simpler to analyze yet structurally equivalent to G n G_n G n ; that is, it is isomorphic to G n G_n G n in some cases. Subsequently, we show how it can be used to give a new interpretation of O ( p ) O(p) O ( p ) with p ≥ 3 p\ge3 p ≥ 3 a prime.
Definition 4. Let n n n be a natural number. Define a graph H n = ( V , E ) H_n=(V,E) H n = ( V , E ) as follows:
The edge set E ⊆ V × V E \subseteq V \times V E ⊆ V × V consists of ordered pairs ( a , b ) (a,b) ( a , b ) such that b ≡ 4 a ( m o d n ) b \equiv4a \pmod{n} b ≡ 4 a ( mod n ) .
Proposition 3. Let p ≥ 3 p \ge3 p ≥ 3 be a prime. Then G p G_p G p and H p H_p H p are isomorphic as directed graphs.
Proof. Define the map
ϕ : V ( G p ) → V ( H p ) by ϕ ( a ) = a 2 ( m o d p ) . \phi: V(G_p) \to V(H_p) \quad\text{by} \quad\phi(a) = a^2 \pmod p. ϕ : V ( G p ) → V ( H p ) by ϕ ( a ) = a 2 ( mod p ) . Since p p p is prime, it implies that there are only two elements a , p − a ∈ Z p ∖ { 0 } a,p-a \in\mathbb{Z}_p \setminus\{0\} a , p − a ∈ Z p ∖ { 0 } whose square is equal to a 2 a^2 a 2 . Therefore, the map ϕ : V ( G p ) → V ( H p ) \phi: V(G_p) \to V(H_p) ϕ : V ( G p ) → V ( H p ) is injective and surjective. Now, suppose that there is a directed edge a → b a \to b a → b in G p G_p G p . Then b ≡ ± 2 a ( m o d p ) b \equiv\pm2a \pmod p b ≡ ± 2 a ( mod p ) . Consider
ϕ ( b ) = b 2 ≡ ( ± 2 a ) 2 = 4 a 2 ≡ 4 ϕ ( a ) ( m o d p ) , \phi(b) = b^2 \equiv(\pm2a)^2 = 4a^2 \equiv4\phi(a) \pmod p, ϕ ( b ) = b 2 ≡ ( ± 2 a ) 2 = 4 a 2 ≡ 4 ϕ ( a ) ( mod p ) , so that there is an edge from ϕ ( a ) \phi(a) ϕ ( a ) to ϕ ( b ) \phi(b) ϕ ( b ) in H p H_p H p . Hence, ϕ \phi ϕ is a homomorphism of graphs.
In order to see that ϕ \phi ϕ is a graph isomorphism, we only need to prove that whenever there is an edge between ϕ ( a ) \phi(a) ϕ ( a ) and ϕ ( b ) \phi(b) ϕ ( b ) , there is an edge between a a a and b b b . If ( ϕ ( a ) , ϕ ( b ) ) ∈ E ( H p ) (\phi(a),\phi(b)) \in E(H_p) ( ϕ ( a ) , ϕ ( b )) ∈ E ( H p ) , then b 2 − 4 a 2 ≡ 0 ( m o d p ) b^2 - 4a^2 \equiv0 \pmod p b 2 − 4 a 2 ≡ 0 ( mod p ) and hence either p ∣ b + 2 a p \mid b+2a p ∣ b + 2 a or p ∣ b − 2 a p \mid b-2a p ∣ b − 2 a . Thus, there is an edge connecting a a a and b b b in the graph G p G_p G p . Hence, ϕ \phi ϕ is a graph isomorphism from G p G_p G p to H p H_p H p . □
Although the graphs G p G_p G p and H p H_p H p are isomorphic whenever p p p is prime, the graph H p H_p H p is often easier to analyze. This is because its vertex set V V V forms a subgroup of Z p × \mathbb{Z}_p^{\times} Z p × , and the structure of H p H_p H p reveals that each disjoint cycle corresponds to a coset of the subgroup ⟨ 4 ⟩ \langle4\rangle ⟨ 4 ⟩ in V V V . Since every cycle in H p H_p H p has the same length, namely ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) , the same holds for the graph G p G_p G p . Therefore, we have the following corollary:
Corollary 1. Let p p p be an odd prime. The number O ( p ) \mathcal{O}(p) O ( p ) of odd cycles in G p G_p G p is given by
O ( p ) = { [ ( F p × ) 2 : ⟨ 4 ⟩ ] = 1 2 ind p ( 4 ) if ord p ( 4 ) is odd ; 0 otherwise. \mathcal{O}(p) =
\begin{cases}
[(\mathbb{F}_p^{\times})^2 : \langle4\rangle] = \frac{1}{2}\operatorname{ind}_p(4) & \text{if } \operatorname{ord}_p(4) \text{ is odd}; \\
0 & \text{otherwise.}
\end{cases} O ( p ) = { [( F p × ) 2 : ⟨ 4 ⟩] = 2 1 ind p ( 4 ) 0 if ord p ( 4 ) is odd ; otherwise.
On noting that
ord p ( 4 ) = ord p ( 2 ) ⋅ { 1 2 if ord p ( 2 ) is even ; 1 otherwise, \operatorname{ord}_p(4)=\operatorname{ord}_p(2)\cdot
\begin{cases}
\frac{1}{2} & \text{if }\operatorname{ord}_p(2)\text{ is even};\\
1 & \text{otherwise,}
\end{cases} ord p ( 4 ) = ord p ( 2 ) ⋅ { 2 1 1 if ord p ( 2 ) is even ; otherwise,
we can alternatively write
O ( p ) = ind p ( 2 ) ⋅ { 1 2 if ord p ( 2 ) is odd ; 1 if ord p ( 2 ) ≡ 2 ( m o d 4 ) ; 0 otherwise. \mathcal{O}(p)=\operatorname{ind}_p(2)\cdot
\begin{cases}
\frac{1}{2} & \text{if }\operatorname{ord}_p(2)\text{ is odd};\\
1 & \text{if }\operatorname{ord}_p(2)\equiv2\pmod{4};\\
0 & \text{otherwise.}
\end{cases} O ( p ) = ind p ( 2 ) ⋅ ⎩ ⎨ ⎧ 2 1 1 0 if ord p ( 2 ) is odd ; if ord p ( 2 ) ≡ 2 ( mod 4 ) ; otherwise.
From this and the second supplementary law of quadratic reciprocity, stating that
( 2 p ) = ( − 1 ) p 2 − 1 8 = { + 1 if p ≡ ± 1 ( m o d 8 ) ; − 1 if p ≡ ± 3 ( m o d 8 ) , (6) \left(\frac{2}{p}\right)=(-1)^{\frac{p^2-1}{8}}=
\begin{cases}
+1 & \text{if }p\equiv\pm1\pmod{8};\\
-1 & \text{if }p\equiv\pm3\pmod{8},
\end{cases} \tag*{(6)} ( p 2 ) = ( − 1 ) 8 p 2 − 1 = { + 1 − 1 if p ≡ ± 1 ( mod 8 ) ; if p ≡ ± 3 ( mod 8 ) , (6)
where ( ⋅ ⋅ ) \left(\frac{\cdot}{\cdot}\right) ( ⋅ ⋅ ) denotes the Legendre symbol, we obtain an easy reproof of the following result of Fu, Lo and Shum [10 ] .
Theorem 7 (Theorem 3 of [10 ] ). If p p p is an odd prime, then
O ( p ) = ind p ( 2 ) ⋅ { 1 2 if p ≡ 7 ( m o d 8 ) , or p ≡ 1 ( m o d 8 ) and ord p ( 2 ) is odd ; 1 if p ≡ 3 ( m o d 8 ) , or p ≡ 1 ( m o d 8 ) and ord p ( 2 ) ≡ 2 ( m o d 4 ) ; 0 if p ≡ 5 ( m o d 8 ) , or p ≡ 1 ( m o d 8 ) and 4 ∣ ord p ( 2 ) . \mathcal{O}(p)=\operatorname{ind}_p(2)\cdot
\begin{cases}
\frac{1}{2} & \text{if }p\equiv7\pmod{8},\text{ or }p\equiv1\pmod{8}\text{ and }\operatorname{ord}_p(2)\text{ is odd};\\
1 & \text{if }p\equiv3\pmod{8},\text{ or }p\equiv1\pmod{8}\text{ and }\operatorname{ord}_p(2)\equiv2\pmod{4};\\
0 & \text{if }p\equiv5\pmod{8},\text{ or }p\equiv1\pmod{8}\text{ and }4\mid\operatorname{ord}_p(2).
\end{cases} O ( p ) = ind p ( 2 ) ⋅ ⎩ ⎨ ⎧ 2 1 1 0 if p ≡ 7 ( mod 8 ) , or p ≡ 1 ( mod 8 ) and ord p ( 2 ) is odd ; if p ≡ 3 ( mod 8 ) , or p ≡ 1 ( mod 8 ) and ord p ( 2 ) ≡ 2 ( mod 4 ) ; if p ≡ 5 ( mod 8 ) , or p ≡ 1 ( mod 8 ) and 4 ∣ ord p ( 2 ) .
Apart from its role in the existence of tight equi-difference codes, the quantity O ( n ) \mathcal{O}(n) O ( n ) is also relevant to the computation of M ( n ) M(n) M ( n ) and M e ( n ) M^e(n) M e ( n ) . When studying conflict-avoiding codes of prime length p p p and weight 3, it is evident that there are no exceptional codewords. For an odd prime p > 3 p>3 p > 3 , the difference set Δ ( x ) \Delta(x) Δ ( x ) has size 4 if x x x is an equi-difference codeword, and 6 otherwise. It follows from Corollary 1 that the graph G p G_p G p consists entirely of either odd or even cycles, depending on whether ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is odd or even, respectively.
To construct an optimal CAC, it is natural to include as many equi-difference codewords as possible. By Proposition 1, a tight equi-difference code of length p p p exists if and only if ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is even. In this case, by the definition of tightness, we have M ( p ) = M e ( p ) = p − 1 4 M(p)=M^e(p)=\frac{p-1}{4} M ( p ) = M e ( p ) = 4 p − 1 .
When ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is odd, we can still construct an equi-difference code C ∈ CAC e ( p ) C\in\operatorname{CAC}^e(p) C ∈ CAC e ( p ) that includes all but one vertex from each cycle in G p G_p G p . Equivalently, there exists a matching in G p G_p G p that covers all but one vertex of every cycle. This leads us to the following result:
M e ( p ) = p − 1 4 − O ( p ) 2 . M^e(p)=\frac{p-1}{4}-\frac{\mathcal{O}(p)}{2}. M e ( p ) = 4 p − 1 − 2 O ( p ) .
As a consequence, we have M ( p ) = M e ( p ) M(p)=M^e(p) M ( p ) = M e ( p ) whenever ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is even. Moreover, by case (c) in § 1.2 any non-equi-difference codeword x = { 0 , a , c } x=\{0,a,c\} x = { 0 , a , c } corresponds to a subset S = { a , b , c } S=\{a,b,c\} S = { a , b , c } satisfying the condition a + b ≡ ± c ( m o d p ) a+b\equiv\pm c\pmod p a + b ≡ ± c ( mod p ) . Therefore, if ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is odd, we obtain the upper and lower bound for M ( p ) M(p) M ( p ) given in (3) . Furthermore, the authors of [10 ] propose an algorithm for constructing non-equi-difference codewords. They conjecture that, for any prime length p p p , the algorithm successfully produces ⌊ O ( p ) 3 ⌋ \left\lfloor\frac{\mathcal{O}(p)}{3}\right\rfloor ⌊ 3 O ( p ) ⌋ such codewords. Subsequent work of Hsia, Li and Sun [16 , 17 ] showed that the upper bound in (3) is attained in several cases. This connection between O ( p ) \mathcal{O}(p) O ( p ) and the upper bound in (3) will be combined in § 8 with our density results to prove Theorem 4.
Remark 4. The order condition occurring in Corollary 1 also has an interpretation in terms of digit expansions of rational numbers. Recall that the length of the period of the base-b b b expansion of 1 / p 1/p 1/ p is ord p ( b ) \operatorname{ord}_p(b) ord p ( b ) . Recent work of Girstmair [11 , 12 ] gives formulas for the mean, and more generally for the mean and variance, of the digits in such a period under prescribed conditions on ord p ( b ) \operatorname{ord}_p(b) ord p ( b ) . Specializing to b = 4 b=4 b = 4 gives a direct connection with O ( p ) O(p) O ( p ) . Indeed, if O ( p ) > 0 O(p)>0 O ( p ) > 0 , then Corollary 1 gives
ord p ( 4 ) = p − 1 2 O ( p ) , \operatorname{ord}_p(4)=\frac{p-1}{2O(p)}, ord p ( 4 ) = 2 O ( p ) p − 1 ,
and this order is odd. Girstmair’s formula for an odd period of length ℓ = p − 1 q \ell=\frac{p-1}{q} ℓ = q p − 1 therefore applies with q = 2 O ( p ) q=2O(p) q = 2 O ( p ) . On the other hand, if O ( p ) = 0 O(p)=0 O ( p ) = 0 , then ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is even, and the digits in one period of the base-4 expansion of 1 / p 1/p 1/ p have mean 3 / 2 3/2 3/2 . Since the correction term in Girstmair’s formula for an odd period is nonzero, combining his result with Corollary 1 gives the characterization
O ( p ) = 0 ⟺ the digits in a period of the base-4 expansion of 1 p have mean 3 2 . O(p)=0 \quad\Longleftrightarrow\quad\text{the digits in a period of the base-4 expansion of }\frac{1}{p}\text{ have mean }\frac{3}{2}. O ( p ) = 0 ⟺ the digits in a period of the base-4 expansion of p 1 have mean 2 3 .
More specifically, Girstmair [12 ] treats periods satisfying ord p ( b ) = p − 1 2 m \operatorname{ord}_p(b)=\frac{p-1}{2^m} ord p ( b ) = 2 m p − 1 . For b = 4 b=4 b = 4 , in the cases in which this order is odd, Corollary 1 gives O ( p ) = 2 m − 1 O(p)=2^{m-1} O ( p ) = 2 m − 1 . Thus his mean and variance formulas provide arithmetic information about the base-4 digit expansions attached to these particular level sets of O ( p ) O(p) O ( p ) .
An Alternative Interpretation of O ( n ) O(n) O ( n )
In this section, we present an alternative interpretation of O ( n ) O(n) O ( n ) , which involves the concept of cyclotomic cosets and good integers.
Cyclotomic coset, minimal polynomials
In Section 2, we obtained two formulas for O ( n ) O(n) O ( n ) directly from the cycle structure of G n G_n G n . We now recover these formulas from the factorization of x n − 1 x^n-1 x n − 1 over F 2 \mathbb{F}_2 F 2 . This provides a different interpretation of O ( n ) O(n) O ( n ) in terms of reciprocal pairs and self-reciprocal irreducible factors.
Let F q \mathbb{F}_q F q denote a finite field of q = p m q=p^m q = p m elements where p p p is a prime and m m m is a positive integer. Let n n n be a positive integer such that ( n , q ) = 1 (n,q)=1 ( n , q ) = 1 . The cyclotomic coset of q q q modulo n n n containing i i i is defined by
C i = { i ⋅ q j ( m o d n ) : j = 0 , 1 , … } . C_i=\{i\cdot q^j\pmod n:j=0,1,\ldots\}. C i = { i ⋅ q j ( mod n ) : j = 0 , 1 , … } .
A subset { i 1 , … , i t } \{i_1,\ldots,i_t\} { i 1 , … , i t } of Z n \mathbb{Z}_n Z n is called a complete set of representatives of cyclotomic cosets of q q q modulo n n n if C i 1 , … , C i t C_{i_1},\ldots,C_{i_t} C i 1 , … , C i t are distinct and ⋃ j = 1 t C i j = Z n \bigcup_{j=1}^{t}C_{i_j}=\mathbb{Z}_n ⋃ j = 1 t C i j = Z n . The following is a well-known result which connects cyclotomic cosets with the factorization of x n − 1 x^n-1 x n − 1 into monic irreducible polynomials over F q \mathbb{F}_q F q .
Proposition 4. Let q q q be a prime power and n n n be a positive integer coprime to q q q . Let α \alpha α be a primitive n n n -th root of unity in F q m \mathbb{F}_{q^m} F q m with m = ord n ( q ) m=\operatorname{ord}_n(q) m = ord n ( q ) . Let { s 1 , … , s t } \{s_1,\ldots,s_t\} { s 1 , … , s t } be a complete set of representatives of cyclotomic cosets of q q q modulo n n n . Then the polynomial x n − 1 x^n-1 x n − 1 factorizes into monic irreducible polynomials over F q \mathbb{F}_q F q as follows:
x n − 1 = ∏ i = 1 t ∏ j ∈ C s i ( x − α j ) = ∏ i = 1 t f i ( x ) . (7) x^n-1=\prod_{i=1}^{t}\prod_{j\in C_{s_i}}(x-\alpha^j)=\prod_{i=1}^{t}f_i(x). \tag*{(7)} x n − 1 = i = 1 ∏ t j ∈ C s i ∏ ( x − α j ) = i = 1 ∏ t f i ( x ) . (7)
From this result it is not difficult to derive the following classical result (Theorem 2.47 of [24 , 25 ] ).
Lemma 1. Let q q q be a prime power and n n n be a positive integer coprime to q q q . The polynomial x n − 1 x^n-1 x n − 1 factors into
i q ( n ) = ∑ d ∣ n φ ( d ) ord d ( q ) = ∑ d ∣ n ind d ( q ) (8) i_q(n)=\sum_{d\mid n}\frac{\varphi(d)}{\operatorname{ord}_d(q)}=\sum_{d\mid n}\operatorname{ind}_d(q) \tag*{(8)} i q ( n ) = d ∣ n ∑ ord d ( q ) φ ( d ) = d ∣ n ∑ ind d ( q ) (8) distinct irreducible factors over F q \mathbb{F}_q F q .
Proof. By Proposition 4, the number of distinct monic irreducible factors of x n − 1 x^n-1 x n − 1 over F q \mathbb{F}_q F q is equal to the number of q q q -cyclotomic cosets modulo n n n . Let
A d = { i ∈ Z n : n gcd ( i , n ) = d } . A_d=\left\{i\in\mathbb{Z}_n:\frac{n}{\gcd(i,n)}=d\right\}. A d = { i ∈ Z n : g cd( i , n ) n = d } . Since A d A_d A d is empty if d ∤ n d\nmid n d ∤ n , we will assume that d d d divides n n n , in which case # A d = φ ( d ) \#A_d=\varphi(d) # A d = φ ( d ) . We claim that every q q q -cyclotomic coset contained in A d A_d A d has cardinality ord d ( q ) \operatorname{ord}_d(q) ord d ( q ) . Indeed, if i ∈ A d i\in A_d i ∈ A d , then the cardinality of C i C_i C i is the smallest positive integer r r r such that i q r ≡ i ( m o d n ) iq^r\equiv i\pmod n i q r ≡ i ( mod n ) . This is equivalent to n ∣ i ( q r − 1 ) n\mid i(q^r-1) n ∣ i ( q r − 1 ) . Writing i = n d u i=\frac{n}{d}u i = d n u , with gcd ( u , d ) = 1 \gcd(u,d)=1 g cd( u , d ) = 1 , we see that this condition is equivalent to d ∣ q r − 1 d\mid q^r-1 d ∣ q r − 1 . The smallest such r r r is precisely ord d ( q ) \operatorname{ord}_d(q) ord d ( q ) . Therefore A d A_d A d is a disjoint union of ind d ( q ) \operatorname{ind}_d(q) ind d ( q ) distinct q q q -cyclotomic cosets and formula (7) is obtained. The term corresponding to d = 1 d=1 d = 1 accounts for the cyclotomic coset C 0 = { 0 } C_0=\{0\} C 0 = { 0 } , with the convention ord 1 ( q ) = 1 \operatorname{ord}_1(q)=1 ord 1 ( q ) = 1 .
We note that x n − 1 = ∏ d ∣ n Φ d ( x ) x^n-1=\prod_{d\mid n}\Phi_d(x) x n − 1 = ∏ d ∣ n Φ d ( x ) , where Φ d ( x ) \Phi_d(x) Φ d ( x ) is the d d d th cyclotomic polynomial. The d d d th cyclotomic polynomial factorizes into ind d ( q ) \operatorname{ind}_d(q) ind d ( q ) irreducibles over F q \mathbb{F}_q F q , provided q q q and d d d are coprime.
As each irreducible factor of x n − 1 x^n-1 x n − 1 over F q \mathbb{F}_q F q corresponds to a cyclic code of length n n n over F q \mathbb{F}_q F q (see, for example, the books of van Lidl and Niederreiter [24 , 25 ] ), determining all irreducible factors of x n − 1 x^n-1 x n − 1 over F q \mathbb{F}_q F q is of paramount importance. Indeed, many papers are devoted to this factorization. A fairly general result in this direction can be found in Brochero-Martinez et al. [7 ] . For more on the connection with coding theory, see for example [5 , 6 ] .
For a polynomial g ( x ) = c 0 + c 1 x + ⋯ + c n − 1 x n − 1 ∈ F q [ x ] g(x)=c_0+c_1x+\cdots+c_{n-1}x^{n-1}\in\mathbb{F}_q[x] g ( x ) = c 0 + c 1 x + ⋯ + c n − 1 x n − 1 ∈ F q [ x ] , we set
g ‾ ( x ) = c n − 1 + c n − 2 x + ⋯ + c 0 x n − 1 . \overline{g}(x)=c_{n-1}+c_{n-2}x+\cdots+c_0x^{n-1}. g ( x ) = c n − 1 + c n − 2 x + ⋯ + c 0 x n − 1 .
Note that g ‾ ( x ) = x n − 1 g ( 1 x ) \overline{g}(x)=x^{n-1}g\left(\frac{1}{x}\right) g ( x ) = x n − 1 g ( x 1 ) and ( g ( x ) ‾ ) ‾ = g ( x ) \overline{\left(\overline{g(x)}\right)}=g(x) ( g ( x ) ) = g ( x ) . Then the reciprocal polynomial of g ( x ) g(x) g ( x ) is g ∗ ( x ) = g ‾ ( x ) / g ( 0 ) g^*(x)=\overline{g}(x)/g(0) g ∗ ( x ) = g ( x ) / g ( 0 ) . In particular, if a polynomial is equal to its reciprocal polynomial over F q \mathbb{F}_q F q , then it is called self-reciprocal over F q \mathbb{F}_q F q .
By the uniqueness of the factorization of a polynomial into irreducible factors, we can express equation (6) in the form
x n − 1 = δ ⋅ g 1 ( x ) ⋯ g s ( x ) ⋅ h 1 ( x ) ⋅ h 1 ∗ ( x ) ⋯ h r ( x ) ⋅ h r ∗ ( x ) , x^n-1=\delta\cdot g_1(x)\cdots g_s(x)\cdot h_1(x)\cdot h_1^*(x)\cdots h_r(x)\cdot h_r^*(x), x n − 1 = δ ⋅ g 1 ( x ) ⋯ g s ( x ) ⋅ h 1 ( x ) ⋅ h 1 ∗ ( x ) ⋯ h r ( x ) ⋅ h r ∗ ( x ) ,
where δ ∈ F q × \delta\in\mathbb{F}_q^\times δ ∈ F q × , the polynomials g 1 , … , g s g_1,\ldots,g_s g 1 , … , g s are self-reciprocal irreducible polynomials, and the pairs h i ( x ) , h i ∗ ( x ) h_i(x),h_i^*(x) h i ( x ) , h i ∗ ( x ) consist of the remaining irreducible factors, grouped together with their reciprocal polynomials.
Proposition 5. Let n ≥ 3 n\ge3 n ≥ 3 be odd. Given a factorization of x n − 1 x^n-1 x n − 1 into monic irreducible polynomials over F 2 \mathbb{F}_2 F 2 , one can compute O ( n ) \mathcal{O}(n) O ( n ) as
O ( n ) = i 2 odd ( n ) + S 2 ( n ) , \mathcal{O}(n)=i_2^{\operatorname{odd}}(n)+S_2(n), O ( n ) = i 2 odd ( n ) + S 2 ( n ) ,
where i 2 o d d ( n ) i_2^{\mathrm{odd}}(n) i 2 odd ( n ) is the number of unordered pairs { f , f ∗ } \{f,f^*\} { f , f ∗ } of distinct reciprocal irreducible factors with deg f \deg f deg f odd, and S 2 ( n ) S_2(n) S 2 ( n ) is the number of self-reciprocal irreducible factors f f f satisfying
deg f ≡ 2 ( m o d 4 ) . \deg f \equiv2 \pmod{4}. deg f ≡ 2 ( mod 4 ) .
In particular, the factor x − 1 x-1 x − 1 contributes to neither term.
Proof. Each nonzero 2-cyclotomic coset C i C_i C i modulo n n n corresponds to an irreducible factor f i f_i f i of x n − 1 x^n-1 x n − 1 over F 2 \mathbb{F}_2 F 2 , with deg f i = ∣ C i ∣ \deg f_i=|C_i| deg f i = ∣ C i ∣ , while f i ∗ f_i^* f i ∗ corresponds to C − i C_{-i} C − i . If C i ≠ C − i C_i\ne C_{-i} C i = C − i , then, after identifying i i i with − i -i − i , the pair { C i , C − i } \{C_i,C_{-i}\} { C i , C − i } gives one cycle of G n G_n G n of length ∣ C i ∣ |C_i| ∣ C i ∣ ; this cycle is odd precisely when deg f i \deg f_i deg f i is odd. If C i = C − i C_i=C_{-i} C i = C − i , then f i f_i f i is self-reciprocal and the corresponding cycle of G n G_n G n has length ∣ C i ∣ / 2 |C_i|/2 ∣ C i ∣/2 ; it is odd precisely when ∣ C i ∣ ≡ 2 ( m o d 4 ) |C_i|\equiv2\pmod{4} ∣ C i ∣ ≡ 2 ( mod 4 ) . These two cases account for all odd cycles of G n G_n G n . Finally, x − 1 x-1 x − 1 corresponds to the zero cyclotomic coset and has degree 1, so it is not counted. □
From (8) , it follows that
i 2 ( n ) = 1 + ∑ d ∣ n , d > 1 2 ∣ ord d ( 2 ) ind d ( 2 ) + ∑ d ∣ n , d > 1 2 ∤ ord d ( 2 ) ind d ( 2 ) . i_2(n)=1+\sum_{\substack{d\mid n,\ d>1\\2\mid\operatorname{ord}_d(2)}}\operatorname{ind}_d(2)+\sum_{\substack{d\mid n,\ d>1\\2\nmid\operatorname{ord}_d(2)}}\operatorname{ind}_d(2). i 2 ( n ) = 1 + d ∣ n , d > 1 2 ∣ ord d ( 2 ) ∑ ind d ( 2 ) + d ∣ n , d > 1 2 ∤ ord d ( 2 ) ∑ ind d ( 2 ) .
where the term 1 is the contribution from the factor x − 1 x-1 x − 1 . Let C i C_i C i be a 2-cyclotomic coset modulo n n n , and put d = n gcd ( i , n ) d=\frac{n}{\gcd(i,n)} d = g c d ( i , n ) n . Then C i = C − i C_i=C_{-i} C i = C − i if and only if there exists an integer j ≥ 1 j\ge1 j ≥ 1 such that 2 j ≡ − 1 ( m o d d ) 2^j\equiv-1\pmod d 2 j ≡ − 1 ( mod d ) . When ord d ( 2 ) \operatorname{ord}_d(2) ord d ( 2 ) is even, this is equivalent to 2 ord d ( 2 ) / 2 ≡ − 1 ( m o d d ) 2^{\operatorname{ord}_d(2)/2}\equiv-1\pmod d 2 ord d ( 2 ) /2 ≡ − 1 ( mod d ) . When ord d ( 2 ) \operatorname{ord}_d(2) ord d ( 2 ) is odd, the equation 2 j ≡ − 1 ( m o d d ) 2^j\equiv-1\pmod d 2 j ≡ − 1 ( mod d ) does not have a solution. Thus Proposition 5 gives, for every odd integer n ≥ 3 n\ge3 n ≥ 3 ,
O ( n ) = ∑ d ∣ n , d > 1 2 ∤ ord d ( 2 ) ind d ( 2 ) + ∑ d ∣ n , d > 1 ord d ( 2 ) ≡ 2 ( m o d 4 ) 2 ord d ( 2 ) / 2 ≡ − 1 ( m o d d ) ind d ( 2 ) . O(n)=\sum_{\substack{d\mid n,\ d>1\\2\nmid\operatorname{ord}_d(2)}}\operatorname{ind}_d(2)+\sum_{\substack{d\mid n,\ d>1\\\operatorname{ord}_d(2)\equiv2\pmod4\\2^{\operatorname{ord}_d(2)/2}\equiv-1\pmod d}}\operatorname{ind}_d(2). O ( n ) = d ∣ n , d > 1 2 ∤ ord d ( 2 ) ∑ ind d ( 2 ) + d ∣ n , d > 1 ord d ( 2 ) ≡ 2 ( mod 4 ) 2 ord d ( 2 ) /2 ≡ − 1 ( mod d ) ∑ ind d ( 2 ) .
This reproves Theorem 6 and Proposition 2.
A reduction lemma and its applications
We next use the prime factorization of n n n to identify the prime-power factors that do not contribute to O ( n ) O(n) O ( n ) . To do so, we require a trivial lemma.
Lemma 2. Let d d d be odd and p 1 , … , p k p_1,\ldots,p_k p 1 , … , p k its prime divisors. Then
ord d ( 2 a ) ≡ lcm ( ord p 1 ( 2 a ) , … , ord p k ( 2 a ) ) ( m o d 2 ) , \operatorname{ord}_d(2^a)\equiv\operatorname{lcm}\left(\operatorname{ord}_{p_1}(2^a),\ldots,\operatorname{ord}_{p_k}(2^a)\right)\pmod2, ord d ( 2 a ) ≡ lcm ( ord p 1 ( 2 a ) , … , ord p k ( 2 a ) ) ( mod 2 ) , where a a a is any positive integer.
Proof. Note that if d = p 1 e 1 ⋯ p k e k d=p_1^{e_1}\cdots p_k^{e_k} d = p 1 e 1 ⋯ p k e k , then ord d ( 2 a ) = lcm ( ord p 1 e 1 ( 2 a ) , … , ord p k e k ( 2 a ) ) \operatorname{ord}_d(2^a)=\operatorname{lcm}\left(\operatorname{ord}_{p_1^{e_1}}(2^a),\ldots,\operatorname{ord}_{p_k^{e_k}}(2^a)\right) ord d ( 2 a ) = lcm ( ord p 1 e 1 ( 2 a ) , … , ord p k e k ( 2 a ) ) by the Chinese Remainder Theorem. The proof is completed on noting that ord p k e k ( 2 a ) \operatorname{ord}_{p_k^{e_k}}(2^a) ord p k e k ( 2 a ) divides p k e k − 1 ord p k ( 2 a ) p_k^{e_k-1}\operatorname{ord}_{p_k}(2^a) p k e k − 1 ord p k ( 2 a ) . □
Proposition 2 together with Lemma 2 shows that prime factors p p p for which ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is even do not contribute to O ( n ) O(n) O ( n ) . This gives the following useful reduction.
Lemma 3. Let n ≥ 3 n\ge3 n ≥ 3 be an odd integer and m m m its largest divisor having only prime factors p p p for which ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is odd. Then O ( n ) = O ( m ) O(n)=O(m) O ( n ) = O ( m ) . Moreover, O ( n ) = 0 O(n)=0 O ( n ) = 0 if and only if m = 1 m=1 m = 1 , that is if and only if ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is even for every prime divisor p p p of n n n .
As a consequence of Lemma 3, we recover the following characterization of Wu and Fu [44 ] .
Theorem 8 (Theorem 1.1 of [44 ] ). Let k ≥ 2 k \ge2 k ≥ 2 .
(1) A tight equi-difference conflict-avoiding code of length 2 k − 1 2^k-1 2 k − 1 and weight 3 exists if and only if k k k is a power of 2.
(2) A tight equi-difference conflict-avoiding code of length 2 k + 1 2^k+1 2 k + 1 and weight 3 exists if and only if k k k is even.
In either case, whenever such a code exists, it has 2 k − 2 2^{k-2} 2 k − 2 codewords. The exceptional case k = 1 k=1 k = 1 in the second family gives the tight code of length 3.
Proof. Suppose first that k = 2 s k=2^s k = 2 s , with s ≥ 1 s \ge1 s ≥ 1 , and put n = 2 k − 1 n=2^k-1 n = 2 k − 1 . Then 3 ∣ n 3 \mid n 3 ∣ n , and, in fact, ν 3 ( n ) = 1 \nu_3(n)=1 ν 3 ( n ) = 1 . If p ∣ n p \mid n p ∣ n and p ≠ 3 p \ne3 p = 3 , then ord p ( 2 ) ∣ k = 2 s \operatorname{ord}_p(2) \mid k=2^s ord p ( 2 ) ∣ k = 2 s . Since ord p ( 2 ) ≠ 1 , 2 \operatorname{ord}_p(2) \ne1,2 ord p ( 2 ) = 1 , 2 , it follows that 4 ∣ ord p ( 2 ) 4 \mid\operatorname{ord}_p(2) 4 ∣ ord p ( 2 ) , and hence ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is even. Thus, Lemma 3 gives O ( n ) = O ( 3 ) = 1 \mathcal{O}(n)=\mathcal{O}(3)=1 O ( n ) = O ( 3 ) = 1 , so Proposition 1 yields a tight equi-difference code.
Conversely, suppose that k k k is not a power of 2. If k > 1 k>1 k > 1 is odd, then 3 ∤ 2 k − 1 3 \nmid2^k-1 3 ∤ 2 k − 1 and 2 k − 1 ≡ 3 ( m o d 4 ) 2^k-1 \equiv3 \pmod{4} 2 k − 1 ≡ 3 ( mod 4 ) . Hence 2 k − 1 2^k-1 2 k − 1 has a prime divisor p ≡ 3 ( m o d 4 ) p \equiv3 \pmod{4} p ≡ 3 ( mod 4 ) . Since ord p ( 4 ) ∣ p − 1 2 \operatorname{ord}_p(4) \mid\frac{p-1}{2} ord p ( 4 ) ∣ 2 p − 1 , and thus ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is odd. By Lemma 3, O ( 2 k − 1 ) > 0 \mathcal{O}(2^k-1)>0 O ( 2 k − 1 ) > 0 . If k = 2 s m k=2^sm k = 2 s m with s ≥ 1 s \ge1 s ≥ 1 and m > 1 m>1 m > 1 odd, then 2 m − 1 ∣ 2 k − 1 2^m-1 \mid2^k-1 2 m − 1 ∣ 2 k − 1 , while 2 m − 1 ≡ 3 ( m o d 4 ) 2^m-1 \equiv3 \pmod{4} 2 m − 1 ≡ 3 ( mod 4 ) and 3 ∤ 2 m − 1 3 \nmid2^m-1 3 ∤ 2 m − 1 . Thus there is a prime p ≠ 3 p \ne3 p = 3 , p ∣ 2 k − 1 p \mid2^k-1 p ∣ 2 k − 1 , with ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) odd. Since 3 ∣ 2 k − 1 3 \mid2^k-1 3 ∣ 2 k − 1 , the divisors 3 and p p p both give positive contributions in (5) , so O ( 2 k − 1 ) > 1 \mathcal{O}(2^k-1)>1 O ( 2 k − 1 ) > 1 .
Now put n = 2 k + 1 n=2^k+1 n = 2 k + 1 . Write k = 2 s m k=2^sm k = 2 s m with m m m odd. For any prime p ∣ n p \mid n p ∣ n , if r = ord p ( 2 ) r=\operatorname{ord}_p(2) r = ord p ( 2 ) , then r ∣ 2 k r \mid2k r ∣ 2 k , r ∤ k r \nmid k r ∤ k . If k k k is even, then s ≥ 1 s \ge1 s ≥ 1 , and these two conditions force ν 2 ( r ) = s + 1 \nu_2(r)=s+1 ν 2 ( r ) = s + 1 . Hence ord p ( 4 ) = r / 2 \operatorname{ord}_p(4)=r/2 ord p ( 4 ) = r /2 is even for every p ∣ n p \mid n p ∣ n . Lemma 3 gives O ( n ) = 0 \mathcal{O}(n)=0 O ( n ) = 0 , and since 3 ∤ n 3 \nmid n 3 ∤ n , Proposition 1 gives a tight code.
If k > 1 k>1 k > 1 is odd, then ν 2 ( r ) = 1 \nu_2(r)=1 ν 2 ( r ) = 1 for every p ∣ n p \mid n p ∣ n , so ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is odd. Moreover 3 ∣ n 3 \mid n 3 ∣ n . If n n n has a prime divisor p ≠ 3 p \ne3 p = 3 , then the divisors 3 and p p p both contribute positively to (5) , and hence O ( n ) > 1 \mathcal{O}(n)>1 O ( n ) > 1 . If n = 3 ℓ n=3^\ell n = 3 ℓ , then ℓ ≥ 2 \ell\ge2 ℓ ≥ 2 . In this case, the divisors 3 and 9 both contribute positively to (5) , since ord 3 ( 4 ) = 1 \operatorname{ord}_3(4)=1 ord 3 ( 4 ) = 1 , 2 ≡ − 1 ( m o d 3 ) 2 \equiv-1 \pmod{3} 2 ≡ − 1 ( mod 3 ) , and ord 9 ( 4 ) = 3 \operatorname{ord}_9(4)=3 ord 9 ( 4 ) = 3 , 2 3 ≡ − 1 ( m o d 9 ) 2^3 \equiv-1 \pmod{9} 2 3 ≡ − 1 ( mod 9 ) . Thus again O ( n ) > 1 \mathcal{O}(n)>1 O ( n ) > 1 .
Finally, count the nonzero differences covered by the code. For n = 2 k + 1 n=2^k+1 n = 2 k + 1 , every codeword contributes four differences, so 4 ∣ C ∣ = n − 1 = 2 k 4|\mathcal{C}|=n-1=2^k 4∣ C ∣ = n − 1 = 2 k . For n = 2 k − 1 n=2^k-1 n = 2 k − 1 , there is one exceptional codeword contributing only two differences, while every other codeword contributes four. Hence 2 + 4 ( ∣ C ∣ − 1 ) = n − 1 = 2 k − 2 2+4(|\mathcal{C}|-1)=n-1=2^k-2 2 + 4 ( ∣ C ∣ − 1 ) = n − 1 = 2 k − 2 . Thus, in either case, ∣ C ∣ = 2 k − 2 |\mathcal{C}|=2^{k-2} ∣ C ∣ = 2 k − 2 .
Counting odd-length orbits via the Cauchy–Frobenius identity
Let a > 1 a>1 a > 1 and m ≥ 1 m \ge1 m ≥ 1 be integers such that gcd ( a , m ) = 1 \gcd(a,m)=1 g cd( a , m ) = 1 . On the additive group Z m \mathbb{Z}_m Z m we define the automorphism α ∈ Aut ( Z m ) \alpha\in\operatorname{Aut}(\mathbb{Z}_m) α ∈ Aut ( Z m ) by α ( x ) = a x \alpha(x)=ax α ( x ) = a x for all x ∈ Z m x \in\mathbb{Z}_m x ∈ Z m . Let n : = ord m ( a ) n:=\operatorname{ord}_m(a) n := ord m ( a ) denote the multiplicative order of a a a modulo m m m , so that ⟨ α ⟩ ≅ C n \langle\alpha\rangle\cong C_n ⟨ α ⟩ ≅ C n is a cyclic group of automorphisms of Z m \mathbb{Z}_m Z m of order n n n .
We let G : = ⟨ α ⟩ G:=\langle\alpha\rangle G := ⟨ α ⟩ act on Z m \mathbb{Z}_m Z m in the natural way: for x ∈ Z m x \in\mathbb{Z}_m x ∈ Z m and k ∈ Z k \in\mathbb{Z} k ∈ Z ,
α k ⋅ x : = α k ( x ) = a k x . \alpha^k \cdot x := \alpha^k(x)=a^k x. α k ⋅ x := α k ( x ) = a k x .
This action partitions Z m \mathbb{Z}_m Z m into G G G -orbits. Reasoning as in the proof of Lemma 1 one sees that
i a ( m ) = ∑ d ∣ m ind d ( a ) . i_a(m)=\sum_{d\mid m}\operatorname{ind}_d(a). i a ( m ) = d ∣ m ∑ ind d ( a ) .
It is also easy to see that the number of odd orbits is equal to
i a o d d ( m ) = ∑ d ∣ m , ord d ( a ) is odd ind d ( a ) . i_a^{\mathrm{odd}}(m)=\sum_{\substack{d\mid m,\ \operatorname{ord}_d(a)\ \text{is odd}}}\operatorname{ind}_d(a). i a odd ( m ) = d ∣ m , ord d ( a ) is odd ∑ ind d ( a ) .
Having expressed i a o d d ( m ) i_a^{\mathrm{odd}}(m) i a odd ( m ) explicitly for a general multiplier a a a , we can specialize to a = 2 a=2 a = 2 and relate this quantity to O ( m ) O(m) O ( m ) , the two invariants agree exactly outside a correction term S 2 ( m ) S_2(m) S 2 ( m ) accounting for self-reciprocal polynomials (see Proposition 5). The total number i a ( m ) i_a(m) i a ( m ) of orbits of the multiplication map x ↦ a x x\mapsto ax x ↦ a x modulo m m m is a classical quantity; for a recent discussion of this orbit-counting problem, its relation with the doubling map, and several of its applications, see Allouche, Stipulanti and Yao [1 ] . Here we require a refinement in which only the orbits of odd length are counted. In fact, if i a o d d ( m ) i_a^{\mathrm{odd}}(m) i a odd ( m ) denotes their number, then
i a o d d ( m ) = 2 i a ( m ) − i a 2 ( m ) , i_a^{\mathrm{odd}}(m)=2i_a(m)-i_{a^2}(m), i a odd ( m ) = 2 i a ( m ) − i a 2 ( m ) ,
as follows by comparing the actions of ⟨ α ⟩ \langle\alpha\rangle ⟨ α ⟩ and ⟨ α 2 ⟩ \langle\alpha^2\rangle ⟨ α 2 ⟩ . Applying the Cauchy–Frobenius identity gives the following explicit formula for it.
Theorem 9. Let a > 1 a>1 a > 1 and m ≥ 1 m\ge1 m ≥ 1 with gcd ( a , m ) = 1 \gcd(a,m)=1 g cd( a , m ) = 1 . Then the number of G G G -orbits of odd length in the action of G = ⟨ α ⟩ G=\langle\alpha\rangle G = ⟨ α ⟩ , where α ( x ) = a x \alpha(x)=ax α ( x ) = a x , on the additive group Z m \mathbb{Z}_m Z m , is given by
i a o d d ( m ) = κ a ( m ) ord m ( a ) ( ∑ d ∣ ord m ( a ) d is odd φ ( ord m ( a ) d ) ( m , a d − 1 ) ) , i_a^{\mathrm{odd}}(m)=\frac{\kappa_a(m)}{\operatorname{ord}_m(a)}
\left(\sum_{\substack{d\mid\operatorname{ord}_m(a)\\d\ \text{is odd}}}\varphi\left(\frac{\operatorname{ord}_m(a)}{d}\right)(m,a^d-1)\right), i a odd ( m ) = ord m ( a ) κ a ( m ) d ∣ ord m ( a ) d is odd ∑ φ ( d ord m ( a ) ) ( m , a d − 1 ) , where κ a ( m ) = 1 \kappa_a(m)=1 κ a ( m ) = 1 if ord m ( a ) \operatorname{ord}_m(a) ord m ( a ) is odd and κ a ( m ) = 2 \kappa_a(m)=2 κ a ( m ) = 2 otherwise.
Proof. To isolate the contribution of odd-length orbits, we consider the subgroup H : = ⟨ α 2 ⟩ ≤ G H:=\langle\alpha^2\rangle\le G H := ⟨ α 2 ⟩ ≤ G , which consists of the even powers of $\alpha. This subgroup acts on Z m \mathbb{Z}_m Z m via
α 2 k ⋅ x : = a 2 k x . \alpha^{2^k}\cdot x:=a^{2k}x. α 2 k ⋅ x := a 2 k x .
We observe that every G G G -orbit of odd length remains a single H H H -orbit, while every G G G -orbit of even length splits into two H H H -orbits of equal size. Let i a e v e n ( m ) i_a^{\mathrm{even}}(m) i a even ( m ) denote the number of G G G -orbits of even length. Then the number of H H H -orbits is given by
∣ H \ Z m ∣ = i a o d d ( m ) + 2 i a e v e n ( m ) . |H\backslash\mathbb{Z}_m|=i_a^{\mathrm{odd}}(m)+2i_a^{\mathrm{even}}(m). ∣ H \ Z m ∣ = i a odd ( m ) + 2 i a even ( m ) .
Solving for i a o d d ( m ) i_a^{\mathrm{odd}}(m) i a odd ( m ) , we deduce that
i a o d d ( m ) = 2 × ∣ G \ Z m ∣ − ∣ H \ Z m ∣ . i_a^{\mathrm{odd}}(m)=2\times|G\backslash\mathbb{Z}_m|-|H\backslash\mathbb{Z}_m|. i a odd ( m ) = 2 × ∣ G \ Z m ∣ − ∣ H \ Z m ∣.
If ord m ( a ) \operatorname{ord}_m(a) ord m ( a ) is odd, then i a o d d ( m ) = ∣ G \ Z m ∣ i_a^{\mathrm{odd}}(m)=|G\backslash\mathbb{Z}_m| i a odd ( m ) = ∣ G \ Z m ∣ . If ord m ( a ) \operatorname{ord}_m(a) ord m ( a ) is even, then by Deaconescu’s identity [8 ] , we have
i a o d d ( m ) = 2 ord m ( a ) ( ∑ d ∣ ord m ( a ) φ ( ord m ( a ) d ) ( m , a d − 1 ) − ∑ d ∣ ord m ( a ) 2 φ ( ord m ( a ) 2 d ) ( m , a 2 d − 1 ) ) = 2 ord m ( a ) ( ∑ d ∣ ord m ( a ) d is odd φ ( ord m ( a ) d ) ( m , a d − 1 ) ) . \begin{aligned}
i_a^{\mathrm{odd}}(m)
&=\frac{2}{\operatorname{ord}_m(a)}
\left(
\sum_{d\mid\operatorname{ord}_m(a)}
\varphi\left(\frac{\operatorname{ord}_m(a)}{d}\right)(m,a^d-1)
-
\sum_{d\mid\frac{\operatorname{ord}_m(a)}{2}}
\varphi\left(\frac{\operatorname{ord}_m(a)}{2d}\right)(m,a^{2d}-1)
\right)\\
&=\frac{2}{\operatorname{ord}_m(a)}
\left(
\sum_{\substack{d\mid\operatorname{ord}_m(a)\\d\ \text{is odd}}}
\varphi\left(\frac{\operatorname{ord}_m(a)}{d}\right)(m,a^d-1)
\right).
\end{aligned} i a odd ( m ) = ord m ( a ) 2 d ∣ ord m ( a ) ∑ φ ( d ord m ( a ) ) ( m , a d − 1 ) − d ∣ 2 ord m ( a ) ∑ φ ( 2 d ord m ( a ) ) ( m , a 2 d − 1 ) = ord m ( a ) 2 d ∣ ord m ( a ) d is odd ∑ φ ( d ord m ( a ) ) ( m , a d − 1 ) .
This closed form is recorded below as a corollary, expressing O ( n ) O(n) O ( n ) solely in terms of ord n ( 2 ) \operatorname{ord}_n(2) ord n ( 2 ) and its divisors, in the same computational spirit as Deaconescu’s identity used earlier for i 2 ( n ) i_2(n) i 2 ( n ) .
Corollary 2. For every odd integer n > 1 n > 1 n > 1 ,
O ( n ) = 1 2 [ x 2 ( n ) ord n ( 2 ) ∑ d ∣ ord n ( 2 ) d o d d φ ( ord n ( 2 ) d ) ( n , 2 d − 1 ) − 1 ] + S 2 ( n ) , \mathcal{O}(n)=\frac{1}{2}\left[\frac{x_2(n)}{\operatorname{ord}_n(2)}\sum_{\substack{d\mid\operatorname{ord}_n(2)\\d\ \mathrm{odd}}}\varphi\left(\frac{\operatorname{ord}_n(2)}{d}\right)(n,2^d-1)-1\right]+S_2(n), O ( n ) = 2 1 ord n ( 2 ) x 2 ( n ) d ∣ ord n ( 2 ) d odd ∑ φ ( d ord n ( 2 ) ) ( n , 2 d − 1 ) − 1 + S 2 ( n ) , where S 2 ( n ) S_2(n) S 2 ( n ) is defined as in Proposition 5.
Applying techniques used in the study of the multiplicative order: initial considerations
The description of O ( p ) \mathcal{O}(p) O ( p ) obtained in Corollary 1 naturally leads to questions concerning primes for which 4 4 4 has prescribed multiplicative order. We therefore recall some results from the theory of near-primitive roots that will be used in the proof of Theorem 2 and later in our study of the level sets of O ( p ) \mathcal{O}(p) O ( p ) in arithmetic progressions.
Given a rational number g g g and a prime p p p such that ν p ( g ) = 0 \nu_p(g)=0 ν p ( g ) = 0 , we denote by ord p ( g ) \operatorname{ord}_p(g) ord p ( g ) the multiplicative order of g g g modulo p p p as defined in Definition 3. Given an integer t > 1 t>1 t > 1 , we say that g g g is a near-primitive root of index t t t if ν p ( g ) = 0 \nu_p(g)=0 ν p ( g ) = 0 and ord p ( g ) = ( p − 1 ) / t \operatorname{ord}_p(g)=(p-1)/t ord p ( g ) = ( p − 1 ) / t . Notice that this entails that p ≡ 1 ( m o d t ) p\equiv1\pmod{t} p ≡ 1 ( mod t ) . Wagstaff [41 ] showed that, assuming GRH, this set of primes has density
δ g ( t ) = ∑ n = 1 ∞ μ ( n ) [ Q ( ζ n t , g 1 / n t ) : Q ] , (9) \delta_g(t)=\sum_{n=1}^{\infty}\frac{\mu(n)}{[\mathbb{Q}(\zeta_{nt},g^{1/nt}):\mathbb{Q}]}, \tag*{(9)} δ g ( t ) = n = 1 ∑ ∞ [ Q ( ζ n t , g 1/ n t ) : Q ] μ ( n ) , (9)
where ζ m = e 2 π i / m \zeta_m=e^{2\pi i/m} ζ m = e 2 π i / m . Actually, for the proof of (9) it is enough to assume that the Dedekind zeta-functions of all fields appearing in (9) with n n n squarefree all have all their non-trivial zeros on the half-line. The proof is an easy generalization of a proof of Hooley [15 ] , who dealt with primitive roots (t = 1 t=1 t = 1 case) and evaluated δ g ( 1 ) \delta_g(1) δ g ( 1 ) . Wagstaff evaluated δ g ( t ) \delta_g(t) δ g ( t ) explicitly in the form ρ ( g ) A \rho(g)A ρ ( g ) A , with ρ ( g ) \rho(g) ρ ( g ) a rational number. He excluded the case where g g g is minus a square, which was later dealt with by Moree [34 ] , whose result is in complete agreement with the determination of this density using a very different, much more algebraic, approach, see Lenstra et al. [22 ] .
Given two coprime positive integers a a a and d d d , we put
Q ( d , a ) = { p > 2 : p ≡ a ( m o d d ) , ord p ( 4 ) = ( p − 1 ) / 2 } . Q(d,a)=\{p>2:p\equiv a\pmod d,\ \operatorname{ord}_p(4)=(p-1)/2\}. Q ( d , a ) = { p > 2 : p ≡ a ( mod d ) , ord p ( 4 ) = ( p − 1 ) /2 } .
These sets provide useful concrete examples of the general near-primitive-root density formula. They will also play a role in § 7 since the condition O ( p ) = 1 \mathcal{O}(p)=1 O ( p ) = 1 is characterized by ord p ( 4 ) = ( p − 1 ) / 2 \operatorname{ord}_p(4)=(p-1)/2 ord p ( 4 ) = ( p − 1 ) /2 , together with the requirement that this order be odd.
The order condition defining Q ( d , a ) Q(d,a) Q ( d , a ) also occurs naturally in the study of digit expansions (cf. Remark 4). If p ∈ Q ( d , a ) p\in Q(d,a) p ∈ Q ( d , a ) , then the base-4 4 4 expansion of 1 / p 1/p 1/ p has period length ( p − 1 ) / 2 (p-1)/2 ( p − 1 ) /2 . Girstmair [13 ] studies the digit frequencies of the base-b b b expansion of 1 / p 1/p 1/ p precisely under the hypothesis
ord p ( b ) = p − 1 2 , \operatorname{ord}_p(b)=\frac{p-1}{2}, ord p ( b ) = 2 p − 1 ,
expressing these frequencies in terms of generalized Bernoulli numbers and determining when they reduce to class numbers of imaginary quadratic fields. In particular, b = 4 b=4 b = 4 belongs to his class-number cases. Thus the primes counted by Q ( d , a ) Q(d,a) Q ( d , a ) also parametrize a family of base-4 4 4 expansions whose digit frequencies admit explicit arithmetic descriptions.
The density δ ( Q ( d , a ) ) \delta(Q(d,a)) δ ( Q ( d , a )) of these sets was determined under GRH in [18 Prop. 1.12] . Before applying these ideas to the general level sets of O ( p ) \mathcal{O}(p) O ( p ) , we discuss two elementary instances of the density calculation, namely d = 1 d=1 d = 1 and d = 8 d=8 d = 8 . For this, and our proof of Theorem 2, we need a small variation of Wagstaff’s result, namely that given a number field K K K , under GRH, the set
{ p splits completely in K and ord p ( g ) = ( p − 1 ) / t } \left\{p\text{ splits completely in }K\text{ and }\operatorname{ord}_p(g)=(p-1)/t\right\} { p splits completely in K and ord p ( g ) = ( p − 1 ) / t }
has density
δ K , g ( t ) = ∑ n = 1 ∞ μ ( n ) [ K ( ζ n t , g 1 / n t ) : Q ] . (10) \delta_{K,g}(t)=\sum_{n=1}^{\infty}\frac{\mu(n)}{[K(\zeta_{nt},g^{1/nt}):\mathbb{Q}]}. \tag*{(10)} δ K , g ( t ) = n = 1 ∑ ∞ [ K ( ζ n t , g 1/ n t ) : Q ] μ ( n ) . (10)
By Wagstaff’s work [41 ] , under GRH, we have δ ( Q ( 1 , 1 ) ) = δ 4 ( 2 ) = 3 A / 2 \delta(\mathbb{Q}(1,1))=\delta_4(2)=3A/2 δ ( Q ( 1 , 1 )) = δ 4 ( 2 ) = 3 A /2 . It follows by (10) with K = Q K=\mathbb{Q} K = Q , g = 4 g=4 g = 4 and t = 2 t=2 t = 2 (or (9) with g = 4 g=4 g = 4 and t = 2 t=2 t = 2 ), that
δ ( Q ( 1 , 1 ) ) = ∑ n = 1 ∞ μ ( n ) [ Q ( ζ 2 n , 4 1 / 2 n ) : Q ] = ∑ n = 1 ∞ μ ( n ) [ Q ( ζ 2 n , 2 1 / n ) : Q ] . (11) \delta(\mathbb{Q}(1,1))=\sum_{n=1}^{\infty}\frac{\mu(n)}{[\mathbb{Q}(\zeta_{2n},4^{1/2n}):\mathbb{Q}]}=\sum_{n=1}^{\infty}\frac{\mu(n)}{[\mathbb{Q}(\zeta_{2n},2^{1/n}):\mathbb{Q}]}. \tag*{(11)} δ ( Q ( 1 , 1 )) = n = 1 ∑ ∞ [ Q ( ζ 2 n , 4 1/2 n ) : Q ] μ ( n ) = n = 1 ∑ ∞ [ Q ( ζ 2 n , 2 1/ n ) : Q ] μ ( n ) . (11)
The following lemma (cf. [32 Lemma 1] ) allows one to determine the field degrees in this sum and rests on the observation that 2 ∈ Q ( ζ n ) \sqrt{2}\in\mathbb{Q}(\zeta_n) 2 ∈ Q ( ζ n ) if and only if 8 ∣ n 8\mid n 8 ∣ n .
Lemma 4. Let m ∣ n m\mid n m ∣ n . We have
[ Q ( ζ n , 2 1 / m ) : Q ] = { φ ( n ) m / 2 if 2 ∣ m and 8 ∣ n ; φ ( n ) m otherwise. [\mathbb{Q}(\zeta_n,2^{1/m}):\mathbb{Q}]=
\begin{cases}
\varphi(n)m/2 & \text{if }2\mid m\text{ and }8\mid n;\\
\varphi(n)m & \text{otherwise.}
\end{cases} [ Q ( ζ n , 2 1/ m ) : Q ] = { φ ( n ) m /2 φ ( n ) m if 2 ∣ m and 8 ∣ n ; otherwise.
We infer that [ Q ( ζ 2 n , 2 1 / n ) : Q ] = φ ( 2 n ) n [\mathbb{Q}(\zeta_{2n},2^{1/n}):\mathbb{Q}]=\varphi(2n)n [ Q ( ζ 2 n , 2 1/ n ) : Q ] = φ ( 2 n ) n if 4 ∤ n 4\nmid n 4 ∤ n , which in combination with (11) yields
δ ( Q ( 1 , 1 ) ) = ∑ n = 1 ∞ μ ( n ) φ ( 2 n ) n . \delta(\mathbb{Q}(1,1))=\sum_{n=1}^{\infty}\frac{\mu(n)}{\varphi(2n)n}. δ ( Q ( 1 , 1 )) = n = 1 ∑ ∞ φ ( 2 n ) n μ ( n ) .
By considering the odd and even n n n separately, one obtains
δ ( Q ( 1 , 1 ) ) = ∑ n = 1 2 ∤ n ∞ μ ( n ) φ ( 2 n ) n + ∑ m = 1 ∞ μ ( 2 m ) φ ( 4 m ) 2 m = 3 4 ∑ n = 1 2 ∤ n ∞ μ ( n ) φ ( n ) n . \delta(\mathbb{Q}(1,1))=\sum_{\substack{n=1\\2\nmid n}}^{\infty}\frac{\mu(n)}{\varphi(2n)n}+\sum_{m=1}^{\infty}\frac{\mu(2m)}{\varphi(4m)2m}=\frac{3}{4}\sum_{\substack{n=1\\2\nmid n}}^{\infty}\frac{\mu(n)}{\varphi(n)n}. δ ( Q ( 1 , 1 )) = n = 1 2 ∤ n ∑ ∞ φ ( 2 n ) n μ ( n ) + m = 1 ∑ ∞ φ ( 4 m ) 2 m μ ( 2 m ) = 4 3 n = 1 2 ∤ n ∑ ∞ φ ( n ) n μ ( n ) .
Using that
∑ n = 1 ( j , n ) = 1 ∞ μ ( n ) f ( n ) = ∏ p ∤ j ( 1 − f ( p ) ) (12) \sum_{\substack{n=1\\(j,n)=1}}^{\infty}\mu(n)f(n)=\prod_{p\nmid j}(1-f(p)) \tag*{(12)} n = 1 ( j , n ) = 1 ∑ ∞ μ ( n ) f ( n ) = p ∤ j ∏ ( 1 − f ( p )) (12)
holds certainly true if the sum is absolutely convergent and f ( n ) f(n) f ( n ) is a multiplicative function defined on the squarefree integers, we then get
δ ( Q ( 1 , 1 ) ) = 3 4 ∏ p > 2 ( 1 − 1 p ( p − 1 ) ) = 3 2 A . \delta(\mathbb{Q}(1,1))=\frac{3}{4}\prod_{p>2}\left(1-\frac{1}{p(p-1)}\right)=\frac{3}{2}A. δ ( Q ( 1 , 1 )) = 4 3 p > 2 ∏ ( 1 − p ( p − 1 ) 1 ) = 2 3 A .
This backside-of-the-envelope calculation simplifies the calculation at [18 pp. 72–73] even further (where for [ Q ( ζ 2 n , 2 1 / 2 n ) : Q ] [\mathbb{Q}(\zeta_{2n},2^{1/2n}):\mathbb{Q}] [ Q ( ζ 2 n , 2 1/2 n ) : Q ] in the final line of page 72 one should read [ Q ( ζ 2 n , 2 1 / n ) : Q ] [\mathbb{Q}(\zeta_{2n},2^{1/n}):\mathbb{Q}] [ Q ( ζ 2 n , 2 1/ n ) : Q ] ).
By the same heads-on approach we now determine δ ( Q ( 8 , j ) ) \delta(\mathbb{Q}(8,j)) δ ( Q ( 8 , j )) with j j j odd.
Lemma 5. Let j j j be an odd integer. If j ≡ 1 ( m o d 8 ) j\equiv1\pmod{8} j ≡ 1 ( mod 8 ) , then Q ( 8 , j ) \mathbb{Q}(8,j) Q ( 8 , j ) is empty, otherwise under GRH we have δ ( Q ( 8 , j ) ) = A / 2 \delta(\mathbb{Q}(8,j))=A/2 δ ( Q ( 8 , j )) = A /2 .
Proof. If p ≡ 1 ( m o d 8 ) p \equiv1 \pmod{8} p ≡ 1 ( mod 8 ) , then ord p ( 2 ) ∣ p − 1 2 \operatorname{ord}_p(2) \mid\frac{p-1}{2} ord p ( 2 ) ∣ 2 p − 1 by (5). Since p − 1 2 \frac{p-1}{2} 2 p − 1 is even, it follows that ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) divides ( p − 1 ) / 4 (p-1)/4 ( p − 1 ) /4 and hence Q ( 8 , 1 ) \mathcal{Q}(8,1) Q ( 8 , 1 ) is empty. We see that Q ( 8 , 5 ) = Q ( 4 , 1 ) \mathcal{Q}(8,5)=\mathcal{Q}(4,1) Q ( 8 , 5 ) = Q ( 4 , 1 ) , the density of which we compute by setting K = Q ( i ) K=\mathbb{Q}(i) K = Q ( i ) , g = 4 g=4 g = 4 and t = 2 t=2 t = 2 in (9). Since Q ( ζ a , ζ b ) = Q ( ζ lcm ( a , b ) ) \mathbb{Q}(\zeta_a,\zeta_b)=\mathbb{Q}(\zeta_{\operatorname{lcm}(a,b)}) Q ( ζ a , ζ b ) = Q ( ζ lcm ( a , b ) ) , we conclude by Lemma 4 that [ Q ( i , ζ 2 n , 2 1 / n ) : Q ] = φ ( lcm ( 4 , 2 n ) ) n [\mathbb{Q}(i,\zeta_{2n},2^{1/n}):\mathbb{Q}]=\varphi(\operatorname{lcm}(4,2n))n [ Q ( i , ζ 2 n , 2 1/ n ) : Q ] = φ ( lcm ( 4 , 2 n )) n if 4 ∤ n 4\nmid n 4 ∤ n . It follows that
δ ( Q ( 8 , 5 ) ) = δ ( Q ( 4 , 1 ) ) = 1 2 ∑ n = 1 ∞ 2 μ ( n ) φ ( lcm ( 4 , 2 n ) ) n = A 2 . \delta(\mathcal{Q}(8,5))=\delta(\mathcal{Q}(4,1))=\frac{1}{2}\sum_{n=1}^{\infty}\frac{2\mu(n)}{\varphi(\operatorname{lcm}(4,2n))n}=\frac{A}{2}. δ ( Q ( 8 , 5 )) = δ ( Q ( 4 , 1 )) = 2 1 n = 1 ∑ ∞ φ ( lcm ( 4 , 2 n )) n 2 μ ( n ) = 2 A .
In the final step we used that the argument in the sum is a multiplicative function in n n n and applied (11) with j = 1 j=1 j = 1 .
The primes p p p that split completely in Q ( 2 ) \mathbb{Q}(\sqrt{2}) Q ( 2 ) are precisely the primes p p p with ( 2 p ) = 1 \left(\frac{2}{p}\right)=1 ( p 2 ) = 1 , that is satisfy p ≡ ± 1 ( m o d 8 ) p\equiv\pm1\pmod{8} p ≡ ± 1 ( mod 8 ) . Recalling that Q ( 8 , 1 ) \mathcal{Q}(8,1) Q ( 8 , 1 ) is empty and using Lemma 4 it now follows that
δ ( Q ( 8 , 7 ) ) = ∑ n = 1 ∞ μ ( n ) [ Q ( 2 , ζ 2 n , 2 1 / n ) : Q ] = 1 2 ∑ n = 1 ∞ μ ( n ) φ ( n ) n = A 2 . \delta(\mathcal{Q}(8,7))=\sum_{n=1}^{\infty}\frac{\mu(n)}{[\mathbb{Q}(\sqrt{2},\zeta_{2n},2^{1/n}):\mathbb{Q}]}=\frac{1}{2}\sum_{n=1}^{\infty}\frac{\mu(n)}{\varphi(n)n}=\frac{A}{2}. δ ( Q ( 8 , 7 )) = n = 1 ∑ ∞ [ Q ( 2 , ζ 2 n , 2 1/ n ) : Q ] μ ( n ) = 2 1 n = 1 ∑ ∞ φ ( n ) n μ ( n ) = 2 A .
Finally,
δ ( Q ( 8 , 3 ) ) = δ ( Q ( 1 , 1 ) ) − δ ( Q ( 8 , 5 ) ) − δ ( Q ( 8 , 7 ) ) = 3 2 A − A 2 − A 2 = A 2 . \delta(\mathcal{Q}(8,3))=\delta(\mathcal{Q}(1,1))-\delta(\mathcal{Q}(8,5))-\delta(\mathcal{Q}(8,7))=\frac{3}{2}A-\frac{A}{2}-\frac{A}{2}=\frac{A}{2}. δ ( Q ( 8 , 3 )) = δ ( Q ( 1 , 1 )) − δ ( Q ( 8 , 5 )) − δ ( Q ( 8 , 7 )) = 2 3 A − 2 A − 2 A = 2 A .
Remark 5. These computations allow one to check once more that, under GRH, δ 1 = A \delta_1=A δ 1 = A (as claimed in Theorem 2). Under that assumption we namely have
δ 1 = δ ( Q ( 4 , 3 ) ) = δ ( Q ( 8 , 3 ) ) + δ ( Q ( 8 , 7 ) ) = A / 2 + A / 2 = A . \delta_1=\delta(\mathcal{Q}(4,3))=\delta(\mathcal{Q}(8,3))+\delta(\mathcal{Q}(8,7))=A/2+A/2=A. δ 1 = δ ( Q ( 4 , 3 )) = δ ( Q ( 8 , 3 )) + δ ( Q ( 8 , 7 )) = A /2 + A /2 = A .
An application
Rodier [38 ] in the context of extended BCH codes established the following result.
Theorem 10. Suppose that p ≡ 7 ( m o d 8 ) p\equiv7\pmod{8} p ≡ 7 ( mod 8 ) and ord p ( 2 ) = ( p − 1 ) / 2 \operatorname{ord}_p(2)=(p-1)/2 ord p ( 2 ) = ( p − 1 ) /2 . Put
S m = ∑ α ∈ F 2 m ( − 1 ) Tr ( α p ) . S_m=\sum_{\alpha\in\mathbb{F}_{2^m}}(-1)^{\operatorname{Tr}(\alpha^p)}. S m = α ∈ F 2 m ∑ ( − 1 ) Tr ( α p ) . where
Tr ( x ) : = ∑ i = 0 m − 1 x 2 i \operatorname{Tr}(x):=\sum_{i=0}^{m-1}x^{2^i} Tr ( x ) := i = 0 ∑ m − 1 x 2 i is the trace of F 2 m \mathbb{F}_{2^m} F 2 m over F 2 \mathbb{F}_2 F 2 . We have
lim sup m → ∞ 2 ∣ m ∣ S m ∣ 2 m / 2 = p − 1. \limsup_{\substack{m\to\infty\\2\mid m}}\frac{|S_m|}{2^{m/2}}=p-1. m → ∞ 2 ∣ m lim sup 2 m /2 ∣ S m ∣ = p − 1.
Note that the primes p p p for which the theorem applies form the set Q ( 8 , 7 ) \mathcal{Q}(8,7) Q ( 8 , 7 ) and by Lemma 5 have density A / 2 A/2 A /2 under GRH. Rodier outlined a different proof of this.
Proof of Theorem 2
Proof. By Corollary 1 the set P k P_k P k consists of the primes p ≡ 1 ( m o d 2 k ) p\equiv1\pmod{2k} p ≡ 1 ( mod 2 k ) , for which ord p ( 4 ) = ( p − 1 ) / 2 k \operatorname{ord}_p(4)=(p-1)/2k ord p ( 4 ) = ( p − 1 ) /2 k and ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is odd.
If k ≡ 2 ( m o d 4 ) k\equiv2\pmod{4} k ≡ 2 ( mod 4 ) , then ( p − 1 ) / 2 k (p-1)/2k ( p − 1 ) /2 k is odd implies that p ≡ 5 ( m o d 8 ) p\equiv5\pmod{8} p ≡ 5 ( mod 8 ) and ord p ( 4 ) = ( p − 1 ) / 2 k \operatorname{ord}_p(4)=(p-1)/2k ord p ( 4 ) = ( p − 1 ) /2 k implies that ord p ( 2 ) ∣ p − 1 2 \operatorname{ord}_p(2)\mid\frac{p-1}{2} ord p ( 2 ) ∣ 2 p − 1 and hence ( 2 p ) = 1 \left(\frac{2}{p}\right)=1 ( p 2 ) = 1 . By the supplementary law of quadratic reciprocity (5), the conditions ( 2 p ) = 1 \left(\frac{2}{p}\right)=1 ( p 2 ) = 1 and p ≡ 5 ( m o d 8 ) p\equiv5\pmod{8} p ≡ 5 ( mod 8 ) cannot be satisfied at the same time. Hence P k P_k P k is empty. For the remainder of the proof we assume GRH. Then it follows from [18 Theorem 3.1] that the number of odd primes p ≤ x p \le x p ≤ x such that ord p ( 4 ) = ( p − 1 ) / 2 k \operatorname{ord}_p(4) = (p-1)/2k ord p ( 4 ) = ( p − 1 ) /2 k and p ≡ 1 ( m o d f ) p \equiv1 \pmod{f} p ≡ 1 ( mod f ) , where f f f is an arbitrary natural number, is given by
δ ( f , k ) x log x + O k , f ( x log log x log 2 x ) \delta(f,k)\frac{x}{\log x}+O_{k,f}\left(\frac{x\log\log x}{\log^2 x}\right) δ ( f , k ) log x x + O k , f ( log 2 x x log log x )
where
δ ( f , k ) : = ∑ n = 1 ∞ μ ( n ) [ Q ( ζ f , ζ 2 n k , 2 1 / n k ) : Q ] \delta(f,k):=\sum_{n=1}^{\infty}\frac{\mu(n)}{[\mathbb{Q}(\zeta_f,\zeta_{2nk},2^{1/nk}):\mathbb{Q}]} δ ( f , k ) := n = 1 ∑ ∞ [ Q ( ζ f , ζ 2 nk , 2 1/ nk ) : Q ] μ ( n )
Let p ≡ 1 ( m o d 2 k ) p \equiv1 \pmod{2k} p ≡ 1 ( mod 2 k ) be a prime. Put r = ν 2 ( 2 k ) r=\nu_2(2k) r = ν 2 ( 2 k ) . Note that ( p − 1 ) / 2 k (p-1)/2k ( p − 1 ) /2 k is odd if and only if p ≡ 1 + 2 r ( m o d 2 r + 1 ) p \equiv1+2^r \pmod{2^{r+1}} p ≡ 1 + 2 r ( mod 2 r + 1 ) . We conclude that
P k ( x ) = δ k x log x + O k ( x log log x log 2 x ) (13) P_k(x)=\delta_k\frac{x}{\log x}+O_k\left(\frac{x\log\log x}{\log^2 x}\right) \tag*{(13)} P k ( x ) = δ k log x x + O k ( log 2 x x log log x ) (13)
where δ k = δ ( 2 r , 2 k ) − δ ( 2 r + 1 , 2 k ) \delta_k=\delta(2^r,2k)-\delta(2^{r+1},2k) δ k = δ ( 2 r , 2 k ) − δ ( 2 r + 1 , 2 k ) .
From now on we assume that k ≢ 2 ( m o d 4 ) k\not\equiv2\pmod{4} k ≡ 2 ( mod 4 ) . It is easy to see that
δ k = ∑ n = 1 2 ∤ n ∞ ( μ ( n ) [ Q ( ζ 2 n k , 2 1 / n k ) : Q ] − μ ( n ) [ Q ( ζ 4 n k , 2 1 / n k ) : Q ] ) . \delta_k=\sum_{\substack{n=1\\2\nmid n}}^{\infty}\left(\frac{\mu(n)}{[\mathbb{Q}(\zeta_{2nk},2^{1/nk}):\mathbb{Q}]}-\frac{\mu(n)}{[\mathbb{Q}(\zeta_{4nk},2^{1/nk}):\mathbb{Q}]}\right). δ k = n = 1 2 ∤ n ∑ ∞ ( [ Q ( ζ 2 nk , 2 1/ nk ) : Q ] μ ( n ) − [ Q ( ζ 4 nk , 2 1/ nk ) : Q ] μ ( n ) ) .
For n n n odd and k ≢ 2 ( m o d 4 ) k\not\equiv2\pmod{4} k ≡ 2 ( mod 4 ) it follows from Lemma 4 that
[ Q ( ζ 4 n k , 2 1 / n k ) : Q ] = 2 [ Q ( ζ 2 n k , 2 1 / n k ) : Q ] [\mathbb{Q}(\zeta_{4nk},2^{1/nk}):\mathbb{Q}]=2[\mathbb{Q}(\zeta_{2nk},2^{1/nk}):\mathbb{Q}] [ Q ( ζ 4 nk , 2 1/ nk ) : Q ] = 2 [ Q ( ζ 2 nk , 2 1/ nk ) : Q ]
and hence we obtain
δ k = δ ( 2 r , 2 k ) − δ ( 2 r + 1 , 2 k ) = ∑ n = 1 2 ∤ n ∞ μ ( n ) [ Q ( ζ 4 n k , 2 1 / n k ) : Q ] . (14) \delta_k=\delta(2^r,2k)-\delta(2^{r+1},2k)=\sum_{\substack{n=1\\2\nmid n}}^{\infty}\frac{\mu(n)}{[\mathbb{Q}(\zeta_{4nk},2^{1/nk}):\mathbb{Q}]}. \tag*{(14)} δ k = δ ( 2 r , 2 k ) − δ ( 2 r + 1 , 2 k ) = n = 1 2 ∤ n ∑ ∞ [ Q ( ζ 4 nk , 2 1/ nk ) : Q ] μ ( n ) . (14)
On invoking Lemma 4 again, we obtain
∑ n = 1 2 ∤ n ∞ μ ( n ) [ Q ( ζ 4 n k , 2 1 / n k ) : Q ] = { 2 S ( k ) if 2 ∣ k ; S ( k ) if 2 ∤ k . (15) \sum_{\substack{n=1\\2\nmid n}}^{\infty}\frac{\mu(n)}{[\mathbb{Q}(\zeta_{4nk},2^{1/nk}):\mathbb{Q}]}=
\begin{cases}
2S(k) & \text{if }2\mid k;\\
S(k) & \text{if }2\nmid k.
\end{cases} \tag*{(15)} n = 1 2 ∤ n ∑ ∞ [ Q ( ζ 4 nk , 2 1/ nk ) : Q ] μ ( n ) = { 2 S ( k ) S ( k ) if 2 ∣ k ; if 2 ∤ k . (15)
where
S ( k ) : = ∑ n ≥ 1 2 ∤ n μ ( n ) φ ( 4 n k ) n k . S(k):=\sum_{\substack{n\ge1\\2\nmid n}}\frac{\mu(n)}{\varphi(4nk)nk}. S ( k ) := n ≥ 1 2 ∤ n ∑ φ ( 4 nk ) nk μ ( n ) .
We have
S ( k ) = 1 k φ ( 4 k ) ∑ n ≥ 1 2 ∤ n μ ( n ) φ ( 4 k ) φ ( 4 n k ) n = 1 k φ ( 4 k ) ∏ p ∣ k , p > 2 ( 1 − 1 p 2 ) ∏ p ∤ k , p > 2 ( 1 − 1 p ( p − 1 ) ) , S(k)=\frac{1}{k\varphi(4k)}\sum_{\substack{n\ge1\\2\nmid n}}\frac{\mu(n)\varphi(4k)}{\varphi(4nk)n}
=\frac{1}{k\varphi(4k)}\prod_{p\mid k,\ p>2}\left(1-\frac{1}{p^2}\right)\prod_{p\nmid k,\ p>2}\left(1-\frac{1}{p(p-1)}\right), S ( k ) = k φ ( 4 k ) 1 n ≥ 1 2 ∤ n ∑ φ ( 4 nk ) n μ ( n ) φ ( 4 k ) = k φ ( 4 k ) 1 p ∣ k , p > 2 ∏ ( 1 − p 2 1 ) p ∤ k , p > 2 ∏ ( 1 − p ( p − 1 ) 1 ) ,
where we used that the argument of the sum is a multiplicative function in n n n . Recall the definition (1) of E ( k ) E(k) E ( k ) . Note that
A ⋅ E ( k ) = 1 k φ ( k ) ∏ p ∣ k ( 1 − 1 p 2 ) ∏ p ∤ k ( 1 − 1 p ( p − 1 ) ) . A\cdot E(k)=\frac{1}{k\varphi(k)}\prod_{p\mid k}\left(1-\frac{1}{p^2}\right)\prod_{p\nmid k}\left(1-\frac{1}{p(p-1)}\right). A ⋅ E ( k ) = k φ ( k ) 1 p ∣ k ∏ ( 1 − p 2 1 ) p ∤ k ∏ ( 1 − p ( p − 1 ) 1 ) .
Comparing the Euler product of S ( k ) S(k) S ( k ) with that of E ( k ) E(k) E ( k ) , we see that
S ( k ) = A ⋅ E ( k ) φ ( k ) φ ( 4 k ) b with b = { 4 3 if 2 ∣ k , 2 if 2 ∤ k . S(k)=A\cdot E(k)\frac{\varphi(k)}{\varphi(4k)}b
\qquad\text{with}\qquad
b=
\begin{cases}
\frac{4}{3} & \text{if }2\mid k,\\
2 & \text{if }2\nmid k.
\end{cases} S ( k ) = A ⋅ E ( k ) φ ( 4 k ) φ ( k ) b with b = { 3 4 2 if 2 ∣ k , if 2 ∤ k .
The proof is completed on combining (13) , (14) , (15) and the latter identity.
Level sets of O ( p ) \mathcal{O}(p) O ( p ) with p p p in a prescribed arithmetic progression
Given a prescribed arithmetic progression a ( m o d d ) a\pmod d a ( mod d ) and any integer k ≥ 0 k\geq0 k ≥ 0 , recall that
P k ( a , d ) : = { p ≡ a ( m o d d ) : O ( p ) = k } . \mathcal{P}_k(a,d):=\{p\equiv a\pmod d:\mathcal{O}(p)=k\}. P k ( a , d ) := { p ≡ a ( mod d ) : O ( p ) = k } .
The case k = 0 k=0 k = 0 , which does not fall within the near-primitive-root framework used below, is treated separately in § 7.1 . We henceforth assume that k ≥ 1 k\geq1 k ≥ 1 .
Theorem 11 (under GRH). Let a a a , d d d , k k k be positive integers. The set P k ( a , d ) \mathcal{P}_k(a,d) P k ( a , d ) has a natural density δ k ( a , d ) \delta_k(a,d) δ k ( a , d ) , and P k ( a , d ) ( x ) \mathcal{P}_k(a,d)(x) P k ( a , d ) ( x ) , the number of primes p ≤ x p\leq x p ≤ x in P k ( a , d ) \mathcal{P}_k(a,d) P k ( a , d ) , satisfies
P k ( a , d ) ( x ) = δ k ( a , d ) x log x + O k , d ( x log log x ( log x ) 2 ) . \mathcal{P}_k(a,d)(x)=\delta_k(a,d)\frac{x}{\log x}+O_{k,d}\left(\frac{x\log\log x}{(\log x)^2}\right). P k ( a , d ) ( x ) = δ k ( a , d ) log x x + O k , d ( ( log x ) 2 x log log x ) .
Proof. We may assume that a a a and d d d are coprime, since otherwise the result is trivially true (with δ k ( a , d ) = 0 \delta_k(a,d)=0 δ k ( a , d ) = 0 ). Note that
P k ( a , d ) = { p ≡ a ( m o d d ) : p ≡ 1 + 2 k ( m o d 4 k ) and ord p ( 4 ) = p − 1 2 k } . \mathcal{P}_k(a,d)=\left\{p\equiv a\pmod d:p\equiv1+2k\pmod{4k}\ \text{and}\ \operatorname{ord}_p(4)=\frac{p-1}{2k}\right\}. P k ( a , d ) = { p ≡ a ( mod d ) : p ≡ 1 + 2 k ( mod 4 k ) and ord p ( 4 ) = 2 k p − 1 } .
In the notation of Hu et al. [18 ] , let
P ( g , t , d , a ) = { p : p ≡ 1 ( m o d t ) , p ≡ a ( m o d d ) , ord p ( g ) = p − 1 t } . \mathcal{P}(g,t,d,a)=\left\{p:p\equiv1\pmod t,\ p\equiv a\pmod d,\ \operatorname{ord}_p(g)=\frac{p-1}{t}\right\}. P ( g , t , d , a ) = { p : p ≡ 1 ( mod t ) , p ≡ a ( mod d ) , ord p ( g ) = t p − 1 } .
Put D = lcm ( d , 4 k ) D=\operatorname{lcm}(d,4k) D = lcm ( d , 4 k ) . If a ≢ 1 + 2 k ( m o d ( d , 4 k ) ) a\not\equiv1+2k\pmod{(d,4k)} a ≡ 1 + 2 k ( mod ( d , 4 k )) , then the two congruence conditions in the definition of P k ( a , d ) \mathcal{P}_k(a,d) P k ( a , d ) are incompatible and P k ( a , d ) \mathcal{P}_k(a,d) P k ( a , d ) is an empty set. Otherwise, let b ( m o d D ) b\pmod D b ( mod D ) be the unique residue class determined by
b ≡ a ( m o d d ) , b ≡ 1 + 2 k ( m o d 4 k ) . b\equiv a\pmod d,\qquad b\equiv1+2k\pmod{4k}. b ≡ a ( mod d ) , b ≡ 1 + 2 k ( mod 4 k ) .
Then P k ( a , d ) = P ( 4 , 2 k , D , b ) \mathcal{P}_k(a,d)=\mathcal{P}(4,2k,D,b) P k ( a , d ) = P ( 4 , 2 k , D , b ) . It now follows from [18 Thm. 3.1] that, under GRH, the number of primes p ≤ x p\leq x p ≤ x in P k ( a , d ) \mathcal{P}_k(a,d) P k ( a , d ) is given by
δ ( 4 , 2 k , D , b ) x log x + O k , d ( x log log x ( log x ) 2 ) , \delta(4,2k,D,b)\frac{x}{\log x}+O_{k,d}\left(\frac{x\log\log x}{(\log x)^2}\right), δ ( 4 , 2 k , D , b ) log x x + O k , d ( ( log x ) 2 x log log x ) ,
where δ ( 4 , 2 k , D , b ) \delta(4,2k,D,b) δ ( 4 , 2 k , D , b ) is the natural density of the set P ( 4 , 2 k , D , b ) \mathcal{P}(4,2k,D,b) P ( 4 , 2 k , D , b ) , and hence we deduce
δ k ( a , d ) = δ ( 4 , 2 k , D , b ) . \delta_k(a,d)=\delta(4,2k,D,b). δ k ( a , d ) = δ ( 4 , 2 k , D , b ) .
We remark that [18 Thm. 3.1] expresses δ ( 4 , 2 k , D , b ) \delta(4,2k,D,b) δ ( 4 , 2 k , D , b ) as an infinite sum involving certain Galois theoretic intersection coefficients. We do not formulate that result here, as for us the simpler variant (10) is enough.
Note that δ k ( a , d ) \delta_k(a,d) δ k ( a , d ) does not change if we replace P k ( a , d ) \mathcal{P}_k(a,d) P k ( a , d ) by a set that only differs in finitely many primes from it. Thus in particular δ k ( 1 , 1 ) = δ k ( 1 , 2 ) \delta_k(1,1)=\delta_k(1,2) δ k ( 1 , 1 ) = δ k ( 1 , 2 ) , which for ease of notation we denote by δ k \delta_k δ k .
The case k = 0 k=0 k = 0
Here we are interested in counting the primes p p p for which ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is even. Counting the primes p p p for which, for given integers d d d and g g g we have d ∣ ord p ( g ) d \mid\operatorname{ord}_p(g) d ∣ ord p ( g ) , is a well-studied problem. In this case the density can be shown to exist unconditionally. It is rather easy to determine and turns out to be a rational number, see for example [31 , 42 , 43 ] .
The case d = 2 d=2 d = 2 is special. For an odd prime p ∤ g p\nmid g p ∤ g , the multiplicative order ord p ( g ) \operatorname{ord}_p(g) ord p ( g ) is even if and only if g k ≡ − 1 ( m o d p ) g^k\equiv-1\pmod p g k ≡ − 1 ( mod p ) for some k ≥ 1 k\ge1 k ≥ 1 , or equivalently, if and only if p p p divides some term of the sequence ( g k + 1 ) k ≥ 1 (g^k+1)_{k\ge1} ( g k + 1 ) k ≥ 1 . Recall that an integer n n n divides a sequence of integers ( a k ) k ≥ 1 (a_k)_{k\ge1} ( a k ) k ≥ 1 if it divides at least one non-zero term. Thus, questions concerning the evenness of the multiplicative order may be viewed as questions about the prime divisors of this sequence. The special case g = 2 g=2 g = 2 , corresponding to the sequence ( 2 k + 1 ) k ≥ 1 (2^k+1)_{k\ge1} ( 2 k + 1 ) k ≥ 1 , has been studied particularly extensively. For an informal description of the method used here, see the survey by Moree [33 ] . Integers dividing the sequence ( a k + b k ) k ≥ 1 (a^k+b^k)_{k\ge1} ( a k + b k ) k ≥ 1 play an important role in coding theory, see [20 , 21 ] .
Proposition 6. Let p p p be an odd prime. We have O ( p ) = 0 \mathcal{O}(p)=0 O ( p ) = 0 if and only if p p p divides ( 4 k + 1 ) k ≥ 1 (4^k+1)_{k\ge1} ( 4 k + 1 ) k ≥ 1 .
Let m > 1 m>1 m > 1 be a positive integer. If m m m divides ( 4 k + 1 ) k ≥ 1 (4^k+1)_{k\ge1} ( 4 k + 1 ) k ≥ 1 , then O ( m ) = 0 \mathcal{O}(m)=0 O ( m ) = 0 .
Proof. As remarked in the introduction of this section, an odd prime p p p divides ( 4 k + 1 ) k ≥ 1 (4^k+1)_{k\ge1} ( 4 k + 1 ) k ≥ 1 if and only if ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is even, which is equivalent with O ( p ) = 0 \mathcal{O}(p)=0 O ( p ) = 0 . All prime divisors p p p of m m m have even ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) . Therefore, by Lemma 3, we have O ( m ) = 0 \mathcal{O}(m)=0 O ( m ) = 0 . □
Remark 6. This proof shows that if m m m divides ( 4 k + 1 ) k ≥ 1 (4^k+1)_{k\ge1} ( 4 k + 1 ) k ≥ 1 for some k ≥ 1 k\ge1 k ≥ 1 , then ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is even for every prime p ∣ m p\mid m p ∣ m . The converse, however, does not hold. Indeed, the condition that m m m divide ( 4 k + 1 ) k ≥ 1 (4^k+1)_{k\ge1} ( 4 k + 1 ) k ≥ 1 is equivalent to the existence of an integer e ≥ 1 e\ge1 e ≥ 1 such that ν 2 ( ord p ( 2 ) ) = e \nu_2(\operatorname{ord}_p(2))=e ν 2 ( ord p ( 2 )) = e for every prime p ∣ m p\mid m p ∣ m by [30 Theorem 1] . On the other hand, the condition O ( m ) = 0 \mathcal{O}(m)=0 O ( m ) = 0 requires only that ν 2 ( ord p ( 2 ) ) ≥ 1 \nu_2(\operatorname{ord}_p(2))\ge1 ν 2 ( ord p ( 2 )) ≥ 1 for every prime p ∣ m p\mid m p ∣ m . The contrast one also sees asymptotically: the number of integers m ≤ x m\le x m ≤ x dividing ( 4 k + 1 ) k ≥ 1 (4^k+1)_{k\ge1} ( 4 k + 1 ) k ≥ 1 grows asymptotically as C 1 x ( log x ) − 2 / 3 C_1x(\log x)^{-2/3} C 1 x ( log x ) − 2/3 (by [30 Theorem 5] ) and when divided by # { m ≤ x : O ( m ) = 0 } \#\{m\le x:\mathcal{O}(m)=0\} # { m ≤ x : O ( m ) = 0 } the ratio tends to zero by Theorem 5.
Recall that the logarithmic integral is defined by Li ( x ) = ∫ 2 x d t log t \operatorname{Li}(x)=\int_2^x\frac{dt}{\log t} Li ( x ) = ∫ 2 x l o g t d t .
Proposition 7. Let
P 0 : = { p > 2 : O ( p ) = 0 } and P 0 ( x ) : = # { p ≤ x : p ∈ P 0 } . \mathcal{P}_0:=\{p>2:\mathcal{O}(p)=0\}\quad\text{and}\quad P_0(x):=\#\{p\le x:p\in\mathcal{P}_0\}. P 0 := { p > 2 : O ( p ) = 0 } and P 0 ( x ) := # { p ≤ x : p ∈ P 0 } . Then
P 0 ( x ) = 5 12 Li ( x ) + O ( x ( log log x ) 4 ( log x ) 3 ) . (16) P_0(x)=\frac{5}{12}\operatorname{Li}(x)+O\left(\frac{x(\log\log x)^4}{(\log x)^3}\right). \tag*{(16)} P 0 ( x ) = 12 5 Li ( x ) + O ( ( log x ) 3 x ( log log x ) 4 ) . (16) In particular, the set of primes p p p for which O ( p ) = 0 \mathcal{O}(p)=0 O ( p ) = 0 has natural density 5 12 \frac{5}{12} 12 5 .
Proof. Since O ( p ) = 0 \mathcal{O}(p)=0 O ( p ) = 0 is equivalent to 2 ∣ ord p ( 4 ) 2\mid\operatorname{ord}_p(4) 2 ∣ ord p ( 4 ) , by applying [31 Thm. 1, Thm. 2] with d = 4 d=4 d = 4 , g = g 0 = 2 g=g_0=2 g = g 0 = 2 , h = 1 h=1 h = 1 and D ( g 0 ) = 8 D(g_0)=8 D ( g 0 ) = 8 . We have γ = 1 \gamma=1 γ = 1 and so ϵ 2 ( 4 ) = 1 4 \epsilon_2(4)=\frac{1}{4} ϵ 2 ( 4 ) = 4 1 and hence obtain (16) .
Alternatively, by applying [30 Thm. 2] with r = 0 r=0 r = 0 , ψ = 4 = 2 2 1 \psi=4=2^{2^1} ψ = 4 = 2 2 1 so that u = 2 u=2 u = 2 , λ = 1 \lambda=1 λ = 1 , and ϵ = 1 \epsilon=1 ϵ = 1 , we obtain
# { p ≤ x : p > 2 , ord p ( 4 ) is odd } = 7 12 Li ( x ) + O ( x ( log log x ) 4 ( log x ) 3 ) . (17) \#\{p\le x:p>2,\ \operatorname{ord}_p(4)\text{ is odd}\}=\frac{7}{12}\operatorname{Li}(x)+O\left(\frac{x(\log\log x)^4}{(\log x)^3}\right). \tag*{(17)} # { p ≤ x : p > 2 , ord p ( 4 ) is odd } = 12 7 Li ( x ) + O ( ( log x ) 3 x ( log log x ) 4 ) . (17)
Taking the complement among the odd primes gives (16) on using the weak prime number estimate ∑ p ≤ x 1 = Li ( x ) + O ( x ( log x ) − 3 ) \sum_{p\le x}1=\operatorname{Li}(x)+O(x(\log x)^{-3}) ∑ p ≤ x 1 = Li ( x ) + O ( x ( log x ) − 3 ) . □
Existing results of Moree and Sury [36 ] allow one to quantify how many primes in a prescribed arithmetic progression satisfy O ( p ) = 0 \mathcal{O}(p)=0 O ( p ) = 0 .
Theorem 12. Let a a a and d d d be positive coprime integers, and let
P 0 ( a , d ) ( x ) : = # { p ≤ x : p ≡ a ( m o d d ) , O ( p ) = 0 } . P_0(a,d)(x) := \#\{p \le x : p \equiv a \pmod{d},\ \mathcal{O}(p)=0\}. P 0 ( a , d ) ( x ) := # { p ≤ x : p ≡ a ( mod d ) , O ( p ) = 0 } . Then there exists a rational number δ 0 ( a , d ) ≥ 0 \delta_0(a,d) \ge0 δ 0 ( a , d ) ≥ 0 such that
P 0 ( a , d ) ( x ) = δ 0 ( a , d ) φ ( d ) Li ( x ) + O ( x log log x ( log x ) 7 / 6 ) . P_0(a,d)(x) = \frac{\delta_0(a,d)}{\varphi(d)} \operatorname{Li}(x) + O\left(\frac{x\log\log x}{(\log x)^{7/6}}\right). P 0 ( a , d ) ( x ) = φ ( d ) δ 0 ( a , d ) Li ( x ) + O ( ( log x ) 7/6 x log log x ) . where δ 0 ( a , d ) ≥ 0 \delta_0(a,d) \ge0 δ 0 ( a , d ) ≥ 0 is rational and can be determined explicitly from Tables 4 and 5 of [36 ] ; In the notation of that paper, one specializes their parameters a , b a,b a , b (which we denote here by A , B A,B A , B to avoid confusion with the residue class a ( m o d d ) a \pmod d a ( mod d ) ) to A = 4 A=4 A = 4 , B = 1 B=1 B = 1 .
Proof. By Proposition 6, for every odd prime p p p we have O ( p ) = 0 \mathcal{O}(p)=0 O ( p ) = 0 if and only if p p p divides 4 j + 1 4^j+1 4 j + 1 for some j ≥ 1 j \ge1 j ≥ 1 . Hence P 0 ( a , d ) ( x ) P_0(a,d)(x) P 0 ( a , d ) ( x ) is exactly the counting function for primes p ≡ a ( m o d d ) p \equiv a \pmod d p ≡ a ( mod d ) dividing at least one term of the sequence ( 4 j + 1 ) j ≥ 1 (4^j+1)_{j\ge1} ( 4 j + 1 ) j ≥ 1 . Applying [36 Theorem 2] with A = 4 A=4 A = 4 and B = 1 B=1 B = 1 yields
P 0 ( a , d ) ( x ) = δ 4 , 1 ( a , d ) Li ( x ) + O ( x log log x ( log x ) 7 / 6 ) . P_0(a,d)(x) = \delta_{4,1}(a,d)\operatorname{Li}(x) + O\left(\frac{x\log\log x}{(\log x)^{7/6}}\right). P 0 ( a , d ) ( x ) = δ 4 , 1 ( a , d ) Li ( x ) + O ( ( log x ) 7/6 x log log x ) . where δ 4 , 1 ( a , d ) \delta_{4,1}(a,d) δ 4 , 1 ( a , d ) is rational and is determined explicitly by Tables 4 and 5 of that paper. Setting δ 0 ( a , d ) : = φ ( d ) δ 4 , 1 ( a , d ) \delta_0(a,d):=\varphi(d)\delta_{4,1}(a,d) δ 0 ( a , d ) := φ ( d ) δ 4 , 1 ( a , d ) gives the asserted formula. The displayed values of δ 0 ( a , d ) \delta_0(a,d) δ 0 ( a , d ) follow by specializing the tables to A = 4 A=4 A = 4 , B = 1 B=1 B = 1 .
Put δ : = ν 2 ( d ) \delta:=\nu_2(d) δ := ν 2 ( d ) and γ = ν 2 ( a − 1 ) \gamma=\nu_2(a-1) γ = ν 2 ( a − 1 ) , with the convention that γ = ∞ \gamma=\infty γ = ∞ when a = 1 a=1 a = 1 . For example, the tables specialize in our case as follows:
δ 0 ( a , d ) = { 5 / 12 if δ ≤ 1 ; 5 / 6 if δ = 2 and γ ≥ 2 ; 0 if δ = 2 and γ = 1. \delta_0(a,d)=
\begin{cases}
5/12 & \text{if }\delta\le1;\\
5/6 & \text{if }\delta=2\text{ and }\gamma\ge2;\\
0 & \text{if }\delta=2\text{ and }\gamma=1.
\end{cases} δ 0 ( a , d ) = ⎩ ⎨ ⎧ 5/12 5/6 0 if δ ≤ 1 ; if δ = 2 and γ ≥ 2 ; if δ = 2 and γ = 1.
The case k = § k=\S k = §
An odd prime p p p is said to be B B B -irregular if p p p divides the numerator of at least one of the Bernoulli numbers B 2 , B 4 , … , B p − 3 B_2,B_4,\ldots,B_{p-3} B 2 , B 4 , … , B p − 3 , and B B B -regular otherwise. The first fifteen B B B -irregular primes are
37 , 59 , 67 , 101 , 103 , 131 , 149 , 157 , 233 , 257 , 263 , 271 , 283 , 293 , 307. 37, 59, 67, 101, 103, 131, 149, 157, 233, 257, 263, 271, 283, 293, 307. 37 , 59 , 67 , 101 , 103 , 131 , 149 , 157 , 233 , 257 , 263 , 271 , 283 , 293 , 307.
Kummer, who introduced the notion of B B B -irregularity, proved that Fermat’s Last Theorem is true for B B B -regular prime exponents p p p . He did this by relating B B B -regularity to a certain cyclotomic class number indivisibility.
The Genocchi numbers G n G_n G n are related to Bernoulli numbers B n B_n B n by the formula
G n = 2 ( 1 − 2 n ) B n . G_n=2(1-2^n)B_n. G n = 2 ( 1 − 2 n ) B n .
An odd prime p p p is said to be G G G -irregular if it divides at least one of the integers G 2 , G 4 , … , G p − 3 G_2,G_4,\ldots,G_{p-3} G 2 , G 4 , … , G p − 3 , and G G G -regular if it does not. The first fifteen G G G -irregular primes are
17 , 31 , 37 , 41 , 43 , 59 , 67 , 73 , 89 , 97 , 101 , 103 , 109 , 113 , 127. 17, 31, 37, 41, 43, 59, 67, 73, 89, 97, 101, 103, 109, 113, 127. 17 , 31 , 37 , 41 , 43 , 59 , 67 , 73 , 89 , 97 , 101 , 103 , 109 , 113 , 127.
Hu et al. [18 ] related the G G G -regularity notion to a class number divisibility. In addition they showed the following easy result relating B B B -regularity and G G G -regularity.
Theorem 13. An odd prime p p p is G G G -regular if and only if it is B B B -regular and satisfies ord p ( 4 ) = ( p − 1 ) / 2 \operatorname{ord}_p(4) = (p-1)/2 ord p ( 4 ) = ( p − 1 ) /2 .
Moree and Sgobba [35 Proposition 4] subsequently placed this characterization in the broader setting of ℓ \ell ℓ -Genocchi numbers defined by ℓ ( 1 − ℓ n ) B n \ell(1-\ell^n)B_n ℓ ( 1 − ℓ n ) B n . They showed that, for a prime ℓ \ell ℓ and an odd prime p ≠ ℓ p \ne\ell p = ℓ , the prime p p p is ℓ \ell ℓ -Genocchi regular if and only if it is B B B -regular and ord p ( ℓ 2 ) = p − 1 2 \operatorname{ord}_p(\ell^2) = \frac{p-1}{2} ord p ( ℓ 2 ) = 2 p − 1 . They also investigated, using Artin-type methods, the distribution in arithmetic progressions of primes satisfying this order condition. These results motivate the study of the sets P 1 ( a , d ) P_1(a,d) P 1 ( a , d ) and their densities.
Theorem 3 is an easy consequence of the work of Hu et al. [18 ] .
Proof of Theorem 3. By Corollary 1 we have O ( p ) = 1 \mathcal{O}(p)=1 O ( p ) = 1 if and only if p ≡ 3 ( m o d 4 ) p \equiv3 \pmod{4} p ≡ 3 ( mod 4 ) and ord p ( 4 ) = ( p − 1 ) / 2 \operatorname{ord}_p(4)=(p-1)/2 ord p ( 4 ) = ( p − 1 ) /2 . Put D = lcm ( d , 4 ) D=\operatorname{lcm}(d,4) D = lcm ( d , 4 ) . If a ≢ 3 ( m o d ( d , 4 ) ) a \not\equiv3 \pmod{(d,4)} a ≡ 3 ( mod ( d , 4 )) , then the congruences 3 ( m o d 4 ) 3 \pmod{4} 3 ( mod 4 ) and a ( m o d d ) a \pmod{d} a ( mod d ) are incompatible. Hence P 1 ( a , d ) ( x ) = 0 P_1(a,d)(x)=0 P 1 ( a , d ) ( x ) = 0 , which agrees with the definition of c ( d , a ) c(d,a) c ( d , a ) . Suppose now that a ≡ 3 ( m o d ( d , 4 ) ) a \equiv3 \pmod{(d,4)} a ≡ 3 ( mod ( d , 4 )) . By the Chinese remainder theorem, there is a unique residue class b ( m o d D ) b \pmod{D} b ( mod D ) such that b ≡ a ( m o d d ) b \equiv a \pmod{d} b ≡ a ( mod d ) and b ≡ 3 ( m o d 4 ) b \equiv3 \pmod{4} b ≡ 3 ( mod 4 ) . Therefore,
P 1 ( a , d ) ( x ) = # { p : p ≡ b ( m o d D ) , ord p ( 4 ) = p − 1 2 } . P_1(a,d)(x)=\#\left\{p:p\equiv b\pmod{D},\ \operatorname{ord}_p(4)=\frac{p-1}{2}\right\}. P 1 ( a , d ) ( x ) = # { p : p ≡ b ( mod D ) , ord p ( 4 ) = 2 p − 1 } .
Since 4 ∣ D 4\mid D 4 ∣ D and b ≡ 3 ( m o d 4 ) b\equiv3\pmod{4} b ≡ 3 ( mod 4 ) , Proposition 1.12 of [18 ] gives, under GRH,
P 1 ( a , d ) ( x ) = A R ( D , b ) φ ( D ) x log x + O d ( x log log x ( log x ) 2 ) . (18) P_1(a,d)(x)=A\frac{R(D,b)}{\varphi(D)}\frac{x}{\log x}+O_d\left(\frac{x\log\log x}{(\log x)^2}\right). \tag*{(18)} P 1 ( a , d ) ( x ) = A φ ( D ) R ( D , b ) log x x + O d ( ( log x ) 2 x log log x ) . (18)
Here the correction factor occurring in [18 Proposition 1.12] is equal to 1, since 4 ∣ D 4\mid D 4 ∣ D and b ≡ 3 ( m o d 4 ) b\equiv3\pmod{4} b ≡ 3 ( mod 4 ) .
We next compare R ( D , b ) R(D,b) R ( D , b ) with R ( d , a ) R(d,a) R ( d , a ) . For every odd prime p ∣ d p\mid d p ∣ d , the congruence b ≡ a ( m o d d ) b\equiv a\pmod d b ≡ a ( mod d ) gives p ∣ b − 1 p\mid b-1 p ∣ b − 1 if and only if p ∣ a − 1 p\mid a-1 p ∣ a − 1 . Moreover, since b ≡ 3 ( m o d 4 ) b\equiv3\pmod4 b ≡ 3 ( mod 4 ) , the contribution of p = 2 p=2 p = 2 to R ( D , b ) R(D,b) R ( D , b ) is 1 (1 / 2 1/2 1/2 to the first product and 2 to the second product). It follows that R ( D , b ) = R ( d , a ) R(D,b)=R(d,a) R ( D , b ) = R ( d , a ) . Finally,
φ ( d ) φ ( D ) = { 1 / 2 4 ∤ d ; 1 4 ∣ d . \frac{\varphi(d)}{\varphi(D)}=
\begin{cases}
1/2 & 4\nmid d;\\
1 & 4\mid d.
\end{cases} φ ( D ) φ ( d ) = { 1/2 1 4 ∤ d ; 4 ∣ d .
Hence
R ( D , b ) φ ( D ) = c ( d , a ) R ( d , a ) φ ( d ) , \frac{R(D,b)}{\varphi(D)}=\frac{c(d,a)R(d,a)}{\varphi(d)}, φ ( D ) R ( D , b ) = φ ( d ) c ( d , a ) R ( d , a ) ,
where c ( d , a ) c(d,a) c ( d , a ) is as defined in the statement of the proposition. Substitution in (18) then yields (2) . □
The distribution of prime values of O ( p ) \mathcal{O}(p) O ( p )
Motivated by a short note of Sun [39 ] , we consider the frequency with which O ( p ) \mathcal{O}(p) O ( p ) is itself a prime number. Sun studies the index
ℓ p = [ F p ∗ : ⟨ − 1 , 2 ⟩ ] = p − 1 2 ord p ( 4 ) . (19) \ell_p=[\mathbb{F}_p^*:\langle-1,2\rangle]=\frac{p-1}{2\operatorname{ord}_p(4)}. \tag*{(19)} ℓ p = [ F p ∗ : ⟨ − 1 , 2 ⟩] = 2 ord p ( 4 ) p − 1 . (19)
We note that the second equality in (19) is explained in Remark 3. Sun, under GRH, determines the ratio of the densities corresponding to odd prime values of ℓ p \ell_p ℓ p to those corresponding to ℓ p > 2 \ell_p > 2 ℓ p > 2 and shows it is between 0.462 and 0.463. More precisely, he showed that the ratio is 6 A C / ( 4 − 7 A ) 6AC/(4-7A) 6 A C / ( 4 − 7 A ) with
C : = ∑ q ≥ 3 q p r i m e q 2 − 1 q 2 ( q 2 − q − 1 ) = ∑ q ≥ 3 q p r i m e 1 q 2 ( 1 + q q 2 − q − 1 ) . C := \sum_{\substack{q\geq3\\q\ \mathrm{prime}}} \frac{q^2-1}{q^2(q^2-q-1)} = \sum_{\substack{q\geq3\\q\ \mathrm{prime}}} \frac{1}{q^2}\left(1+\frac{q}{q^2-q-1}\right). C := q ≥ 3 q prime ∑ q 2 ( q 2 − q − 1 ) q 2 − 1 = q ≥ 3 q prime ∑ q 2 1 ( 1 + q 2 − q − 1 q ) .
Using the algorithms (or the Pari/Gp functions) described in § 5 of Belabas-Cohen [4 ] , it is easy to obtain
C = 0.28488937295069592789537460144246417687 … , (20) C = 0.28488937295069592789537460144246417687\ldots, \tag*{(20)} C = 0.28488937295069592789537460144246417687 … , (20)
giving the much more precise value 0.4624263335000077349204 … 0.4624263335000077349204\ldots 0.4624263335000077349204 … for Sun’s ratio. Theorem 2 allows us to likewise determine, under GRH, an analogous ratio R R R for O ( p ) O(p) O ( p ) . It is the ratio of primes p p p for which O ( p ) O(p) O ( p ) is prime to those primes p p p for which O ( p ) > 2 O(p)>2 O ( p ) > 2 .
Proposition 8. Assume GRH. Define
R : = ∑ q ≥ 3 q p r i m e δ q ∑ k ≥ 3 δ k . R := \frac{\sum_{\substack{q\geq3\\q\ \mathrm{prime}}}\delta_q}{\sum_{k\geq3}\delta_k}. R := ∑ k ≥ 3 δ k ∑ q ≥ 3 q prime δ q . We have
R = 12 A C 7 − 12 A = 12 A 7 − 12 A ∑ q ≥ 3 q p r i m e q 2 − 1 q 2 ( q 2 − q − 1 ) = 0.5088227112380472975588 … . R=\frac{12AC}{7-12A}=\frac{12A}{7-12A}\sum_{\substack{q\geq3\\q\ \mathrm{prime}}}\frac{q^2-1}{q^2(q^2-q-1)}=0.5088227112380472975588\ldots. R = 7 − 12 A 12 A C = 7 − 12 A 12 A q ≥ 3 q prime ∑ q 2 ( q 2 − q − 1 ) q 2 − 1 = 0.5088227112380472975588 … .
Proof. For an odd prime q q q , Theorem 2 gives
δ q = A q 2 − 1 q 2 ( q 2 − q − 1 ) , \delta_q=A\frac{q^2-1}{q^2(q^2-q-1)}, δ q = A q 2 ( q 2 − q − 1 ) q 2 − 1 ,
showing that the sum in the numerator of R R R equals A C AC A C . It remains to determine the denominator of R R R . Note that ∑ k ≥ 1 δ k \sum_{k\geq1}\delta_k ∑ k ≥ 1 δ k is merely the density of primes p p p for which ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is odd, which by Proposition 7 is 7 / 12 7/12 7/12 . Since δ 1 = A \delta_1=A δ 1 = A and δ 2 = 0 \delta_2=0 δ 2 = 0 , we obtain
∑ k ≥ 3 δ k = 7 12 − A , \sum_{k\geq3}\delta_k=\frac{7}{12}-A, k ≥ 3 ∑ δ k = 12 7 − A ,
leading to the claimed expression for R R R . Using a sufficiently precise numerical value of the Artin constant and (19), the indicated numerical approximation of R R R is obtained. □
Remark 7. As a sanity check we can try to compute ∑ k ≥ 1 δ k \sum_{k\geq1}\delta_k ∑ k ≥ 1 δ k directly, making use of the multiplicativity of E ( k ) E(k) E ( k ) .
For an odd prime q q q we have
1 + ∑ r ≥ 1 E ( q r ) = 1 + q 2 − 1 q 2 − q − 1 ∑ r ≥ 1 1 q 2 r = q ( q − 1 ) q ( q − 1 ) − 1 . 1+\sum_{r\geq1}E(q^r)=1+\frac{q^2-1}{q^2-q-1}\sum_{r\geq1}\frac{1}{q^{2r}}=\frac{q(q-1)}{q(q-1)-1}. 1 + r ≥ 1 ∑ E ( q r ) = 1 + q 2 − q − 1 q 2 − 1 r ≥ 1 ∑ q 2 r 1 = q ( q − 1 ) − 1 q ( q − 1 ) .
Therefore, we obtain
∏ q o d d ( 1 + ∑ r ≥ 1 E ( q r ) ) = ∏ q o d d ( 1 − 1 q ( q − 1 ) ) − 1 = 1 2 A . \prod_{q\ \mathrm{odd}}\left(1+\sum_{r\geq1}E(q^r)\right)=\prod_{q\ \mathrm{odd}}\left(1-\frac{1}{q(q-1)}\right)^{-1}=\frac{1}{2A}. q odd ∏ ( 1 + r ≥ 1 ∑ E ( q r ) ) = q odd ∏ ( 1 − q ( q − 1 ) 1 ) − 1 = 2 A 1 .
For q = 2 q = 2 q = 2 , Theorem 2 shows that the contribution with ν 2 ( k ) = 1 \nu_2(k) = 1 ν 2 ( k ) = 1 vanishes, whereas the contribution with ν 2 ( k ) ≥ 2 \nu_2(k) \ge2 ν 2 ( k ) ≥ 2 is multiplied by 2 / 3 2/3 2/3 . Thus, the corresponding local factor is
1 + 2 3 ∑ r ≥ 2 3 4 r = 1 + 1 6 = 7 6 . 1 + \frac{2}{3}\sum_{r\ge2}\frac{3}{4^r}=1+\frac{1}{6}=\frac{7}{6}. 1 + 3 2 r ≥ 2 ∑ 4 r 3 = 1 + 6 1 = 6 7 .
It follows that
∑ k ≥ 1 δ k = A ⋅ 1 2 A ⋅ 7 6 = 7 12 . \sum_{k\ge1}\delta_k=A\cdot\frac{1}{2A}\cdot\frac{7}{6}=\frac{7}{12}. k ≥ 1 ∑ δ k = A ⋅ 2 A 1 ⋅ 6 7 = 12 7 .
Proof of Theorem 4. Hsia, Li and Sun [17 ] proved that if 4 ∤ ord p ( 2 ) 4 \nmid\operatorname{ord}_p(2) 4 ∤ ord p ( 2 ) and [ F p × : ⟨ − 1 , 2 ⟩ ] [\mathbb{F}_p^\times:\langle-1,2\rangle] [ F p × : ⟨ − 1 , 2 ⟩] is an odd prime, then the upper bound in (3) is attained. Since O ( p ) > 0 \mathcal{O}(p)>0 O ( p ) > 0 implies
4 ∤ ord p ( 2 ) and O ( p ) = [ F p × : ⟨ − 1 , 2 ⟩ ] , 4 \nmid\operatorname{ord}_p(2) \qquad\text{and}\qquad\mathcal{O}(p)=[\mathbb{F}_p^\times:\langle-1,2\rangle], 4 ∤ ord p ( 2 ) and O ( p ) = [ F p × : ⟨ − 1 , 2 ⟩] ,
their result, together with Proposition 8, yields the theorem. □
The distribution of O(n) for integer n: proof of Theorem 5
Proof of Theorem 5. First assume that e = 0 e=0 e = 0 . By Lemma 3 we have O ( m ) = 0 \mathcal{O}(m)=0 O ( m ) = 0 if and only if ord p ( 4 ) \operatorname{ord}_p(4) ord p ( 4 ) is even for every prime divisor p p p of m m m . The integers counted by N 0 ( x ) N_0(x) N 0 ( x ) , together with 1 1 1 , form the completely multiplicative set consisting of the integers all of whose prime divisors belong to P 0 P_0 P 0 . Applying [30 Thm. 4] with τ = 5 12 \tau=\frac{5}{12} τ = 12 5 and g = 4 g=4 g = 4 , we obtain
N 0 ( x ) = C 0 x ( log x ) 7 / 12 + O ( x ( log log x ) 5 ( log x ) 19 / 12 ) (21) N_0(x)=C_0\frac{x}{(\log x)^{7/12}}+O\left(\frac{x(\log\log x)^5}{(\log x)^{19/12}}\right) \tag*{(21)} N 0 ( x ) = C 0 ( log x ) 7/12 x + O ( ( log x ) 19/12 x ( log log x ) 5 ) (21)
for some constant C 0 > 0 C_0>0 C 0 > 0 . Applying Proposition 4 of Finch, Martin and Sebah [9 ] , we then obtain the stated formula for C 0 C_0 C 0 (the prime counting condition of the proposition is satisfied by (17) ). Using t = 10 11 t=10^{11} t = 1 0 11 one can see that C 0 = 0.32235 … C_0=0.32235\ldots C 0 = 0.32235 … (such decimals are confirmed by comparison with the cases t = 10 j t=10^j t = 1 0 j , j = 5 , 6 , 7 , 8 , 9 , 10 j=5,6,7,8,9,10 j = 5 , 6 , 7 , 8 , 9 , 10 ).
Next assume that e ≥ 1 e\ge1 e ≥ 1 . Let p p p be a prime such that p ≡ 3 ( m o d 4 ) p\equiv3\pmod4 p ≡ 3 ( mod 4 ) , ord p ( 2 ) = p − 1 \operatorname{ord}_p(2)=p-1 ord p ( 2 ) = p − 1 and ord p 2 ( 2 ) = p ( p − 1 ) \operatorname{ord}_{p^2}(2)=p(p-1) ord p 2 ( 2 ) = p ( p − 1 ) , the first few being p = 3 , 11 , 19 , 59 , 67 , 83 , 107 , 131 , 139 , 163 , … p=3,11,19,59,67,83,107,131,139,163,\ldots p = 3 , 11 , 19 , 59 , 67 , 83 , 107 , 131 , 139 , 163 , … . Then we have ind p ( 2 ) = ind p 2 ( 2 ) = 1 \operatorname{ind}_p(2)=\operatorname{ind}_{p^2}(2)=1 ind p ( 2 ) = ind p 2 ( 2 ) = 1 . It then follows by elementary number theory that ind p j ( 2 ) = 1 \operatorname{ind}_{p^j}(2)=1 ind p j ( 2 ) = 1 for all j ≥ 1 j\ge1 j ≥ 1 (see Theorem 2 of [19 ] ). Moreover, for j ≥ 1 j\ge1 j ≥ 1 we have ord p j ( 2 ) = ( p − 1 ) p j − 1 ≡ 2 ⋅ 3 j − 1 ≡ 2 ( m o d 4 ) \operatorname{ord}_{p^j}(2)=(p-1)p^{j-1}\equiv2\cdot3^{j-1}\equiv2\pmod4 ord p j ( 2 ) = ( p − 1 ) p j − 1 ≡ 2 ⋅ 3 j − 1 ≡ 2 ( mod 4 ) . Hence by Theorem 6 we have
O ( p e ) = ∑ i = 1 e ind 2 ( p i ) = e . \mathcal{O}(p^e)=\sum_{i=1}^{e}\operatorname{ind}_2(p^i)=e. O ( p e ) = i = 1 ∑ e ind 2 ( p i ) = e .
In fact, there are infinitely many n ≥ 1 n\ge1 n ≥ 1 such that O ( n ) = e \mathcal{O}(n)=e O ( n ) = e : it suffices to take n = p e p 1 e 1 ⋯ p s e s n=p^e p_1^{e_1}\cdots p_s^{e_s} n = p e p 1 e 1 ⋯ p s e s , where p p p is as above, p 1 , … , p s p_1,\ldots,p_s p 1 , … , p s are prime numbers such that ord p i ( 4 ) \operatorname{ord}_{p_i}(4) ord p i ( 4 ) is even for all i i i . Then by Lemma 3 we have O ( n ) = O ( p e ) = e \mathcal{O}(n)=\mathcal{O}(p^e)=e O ( n ) = O ( p e ) = e . Consequently N e ( x ) ≥ N 0 ( x / p e ) N_e(x)\ge N_0(x/p^e) N e ( x ) ≥ N 0 ( x / p e ) , which on invoking the first part of the theorem leads to the claimed lower bound on N e ( x ) N_e(x) N e ( x ) . □
Remark 8. Using the supplementary law of quadratic reciprocity, see (6) , it is easy to see that the primes p = 3 , 11 , 19 , … p=3,11,19,\ldots p = 3 , 11 , 19 , … listed above actually have to satisfy p ≡ 3 ( m o d 8 ) p\equiv3\pmod8 p ≡ 3 ( mod 8 ) .
Proof of Theorem 1
Proof. We first consider prime lengths. By Proposition 1, if p ≠ 3 p \ne3 p = 3 is an odd prime, then a tight equi-difference conflict-avoiding code of length p p p exists if and only if O ( p ) = 0 O(p)=0 O ( p ) = 0 . The prime p = 3 p=3 p = 3 also gives a tight equi-difference code, since 3 ∣ p 3 \mid p 3 ∣ p and O ( 3 ) = 1 O(3)=1 O ( 3 ) = 1 . Thus by Corollary 1 we have P ( x ) = 1 + # { p ≤ x : 2 ∣ ord p ( 4 ) } P(x)=1+\#\{p\le x:2\mid\operatorname{ord}_p(4)\} P ( x ) = 1 + # { p ≤ x : 2 ∣ ord p ( 4 )} for x ≥ 3 x\ge3 x ≥ 3 . It then follows by (16) that
P ( x ) = 5 12 x log x + O ( x ( log log x ) 4 ( log x ) 3 ) . P(x)=\frac{5}{12}\frac{x}{\log x}+O\left(\frac{x(\log\log x)^4}{(\log x)^3}\right). P ( x ) = 12 5 log x x + O ( ( log x ) 3 x ( log log x ) 4 ) .
We next consider odd integer lengths. By Proposition 1 we infer that N ( x ) = N 0 ( x ) + N 0 ( x / 3 ) N(x)=N_0(x)+N_0(x/3) N ( x ) = N 0 ( x ) + N 0 ( x /3 ) , with N 0 ( x ) N_0(x) N 0 ( x ) defined as in Theorem 5. Invoking the estimate (21) , we obtain
N ( x ) = 4 C 0 3 x ( log x ) 7 / 12 + O ( x ( log log x ) 5 ( log x ) 19 / 12 ) , N(x)=\frac{4C_0}{3}\frac{x}{(\log x)^{7/12}}+O\left(\frac{x(\log\log x)^5}{(\log x)^{19/12}}\right), N ( x ) = 3 4 C 0 ( log x ) 7/12 x + O ( ( log x ) 19/12 x ( log log x ) 5 ) ,
with C 0 = 0.32235 … C_0=0.32235\ldots C 0 = 0.32235 … Thus C = 4 C 0 / 3 = 0.4298 … C=4C_0/3=0.4298\ldots C = 4 C 0 /3 = 0.4298 … , completing the proof. □
AI Disclosure. The contributions of P.M., S.P, and P.S. to this article were made without the use of AI, K. B. used ChatGPT (OpenAI) for language editing and to improve clarity and presentation of the text.
Acknowledgment. This paper was initiated by the second author. The first and third authors joined the project during their stay at the Max Planck Institute for Mathematics (from March to May 2025). They all thank the staff of the institute for the hospitality and good working conditions. The first author acknowledges financial support from the IIT Goa Start-up Grant (Grant No. 2026/SG/KB/063). We thank J-P. Allouche and P. Sole for helpful feedback. A. Languasco, starting in a later stage in the project, very kindly provided us with continuous feedback. Furthermore, he numerically approximated the constant C 0 C_0 C 0 in Theorem 5.
References
SCHOOL OF MATHEMATICS AND COMPUTER SCIENCE, INDIAN INSTITUTE OF TECHNOLOGY GOA, FARMAGUDI, PONDA-403401, GOA, INDIA
Email address: karthick@iitgoa.ac.in
MAX PLANCK INSTITUTE FOR MATHEMATICS, VIVATSGASSE 7, 53111 BONN, GERMANY
Email address: moree@mpim-bonn.mpg.de
DEPARTMENT OF MATHEMATICS, SRI A.S.N.M. GOVT. COLLEGE (A), PALAKOLLU, WEST GODAVARI DIST.- 534260, ANDHRA PRADESH, INDIA.
Email address: sunilkumarpasupulati@gmail.com
DIVISION OF NATURAL AND APPLIED SCIENCES, DUKE KUNSHAN UNIVERSITY, 8 DUKE AVENUE, KUNSHAN, CHINA 215316
Email address: pietro.sgobba@dukekunshan.edu.cn