betaFeedback

WorksMathematics

Conflict-avoiding codes and near-primitive roots

Abstract

An important role in the theory of conflict-avoiding codes is played by a quantity involving the multiplicative order of 44 modulo dd, with dd running over all positive divisors of an odd integer nn. We establish results on its distribution as nn varies over the odd prime numbers, respectively odd integers, using techniques from the study of Artin's primitive root conjecture. We also point out some other interpretations of this quantity, with one of them making a connection with the factorization of Xn−1X^n-1 into irreducibles over the finite field F2\mathbb F_2.

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 nn, we let Zn\mathbb{Z}_n denote the ring of integers modulo nn, and let P(n,k)\mathcal{P}(n,k) represent the set of all kk-element subsets of Zn\mathbb{Z}_n. Each element x∈P(n,k)x \in\mathcal{P}(n,k) can be associated with a binary sequence of length nn and weight kk, indicating the positions of the nonzero entries. For a given subset x∈P(n,k)x \in\mathcal{P}(n,k), we define its difference set as follows:

Δ(x):={a−b(modn):a,b∈x, a≠b}.\Delta(x) := \{a-b \pmod n : a,b \in x,\ a \ne b\}.

Note that ∣Δ(x)∣≤k(k−1)|\Delta(x)| \le k(k-1), and if i∈Δ(x)i \in\Delta(x), then n−i∈Δ(x)n-i \in\Delta(x) as well; that is, Δ(x)\Delta(x) is symmetric with respect to n/2n/2. A conflict-avoiding code (CAC) of length nn and weight kk is defined as a subset C⊂P(n,k)\mathcal{C} \subset\mathcal{P}(n,k) such that for any distinct x,y∈Cx,y \in\mathcal{C}, the intersection Δ(x)∩Δ(y)\Delta(x) \cap\Delta(y) is empty. Each element x∈Cx \in\mathcal{C} is referred to as a codeword of length nn and weight kk. Without loss of generality, we can assume that all codewords contain 00. For example C={{0,1,6},{0,4,8}}\mathcal{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), respectively (1,0,0,0,1,0,0,0,1,0,0)(1,0,0,0,1,0,0,0,1,0,0).

For given nn and kk, let CAC⁡(n,k)\operatorname{CAC}(n,k) denote the class of all CACs of length nn with weight kk. The maximum possible size of the codes in CAC⁡(n,k)\operatorname{CAC}(n,k) will be denoted by 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)\}.

A code C∈CAC⁡(n,k)\mathcal{C} \in\operatorname{CAC}(n,k) is said to be optimal, if ∣C∣=M(n,k)|\mathcal{C}| = M(n,k). The above example is optimal in CAC⁡(11,3)\operatorname{CAC}(11,3), that is, M(11,3)=2M(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) is said to be equi-difference (or centered in the case k=3k=3) with generator i∈Zn∖{0}i \in\mathbb{Z}_n \setminus\{0\} if it has the form

x=xi={0,i,2i,…,(k−1)i}(modn),x=x_i=\{0,i,2i,\ldots,(k-1)i\}\pmod n,

and consists of kk distinct residues modulo nn. A code C⊂P(n,k)\mathcal{C} \subset P(n,k) is called an equi-difference conflict-avoiding code if every codeword in C\mathcal{C} is equi-difference. It is denoted CAC⁡e(n,k)\operatorname{CAC}^{\mathrm{e}}(n,k). Note that for an equi-difference codeword xix_i, we have

Δ(xi)={±ji(modn):1≤j≤k−1},\Delta(x_i)=\{\pm ji\pmod n:1\le j\le k-1\},

which implies that ∣Δ(xi)∣≤2(k−1)|\Delta(x_i)|\le2(k-1). A codeword satisfying ∣Δ(xi)∣≤2(k−1)|\Delta(x_i)|\le2(k-1) is said to be exceptional. Moreover, an optimal code C∈CAC⁡(n,k)\mathcal{C}\in\operatorname{CAC}(n,k) is said to be tight if

⋃x∈CΔ(x)=Zn∖{0}.\bigcup_{x\in\mathcal{C}}\Delta(x)=\mathbb{Z}_n\setminus\{0\}.

The maximum code size in CAC⁡e(n,k)\operatorname{CAC}^{\mathrm{e}}(n,k) will be denoted by Me(n,k)M^{\mathrm{e}}(n,k), i.e.,

Me(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)\}.

For the remainder of this section we take k=3k=3. It is easy to verify that a general codeword xx satisfies

2≤∣Δ(x)∣≤6.2\le|\Delta(x)|\le6.

Moreover, if ∣Δ(x)∣=4|\Delta(x)|=4, then xx must be an equi-difference codeword. For exceptional codewords, we have:

  • ∣Δ(x)∣=2|\Delta(x)|=2 if and only if 3∣n3\mid n and x={0,n/3,2n/3}x=\{0,n/3,2n/3\},

  • ∣Δ(x)∣=3|\Delta(x)|=3 if and only if 4∣n4\mid n and 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) and M(n)M(n) instead of CAC⁡(n,3)\operatorname{CAC}(n,3), respectively M(n,3)M(n,3). Likewise, we denote CAC⁡e(n,3)\operatorname{CAC}^{\mathrm{e}}(n,3) and Me(n,3)M^{\mathrm{e}}(n,3) by CAC⁡e(n)\operatorname{CAC}^{\mathrm{e}}(n), respectively Me(n)M^{\mathrm{e}}(n). Following Momihara [29] we now define a graph GnG_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 nn, define a graph Gn=(V,E)G_n=(V,E) as follows:

  • The vertex set is

V={1,2,…,(n−1)/2}.V=\{1,2,\ldots,(n-1)/2\}.
  • The edge set E⊆V×VE\subseteq V\times V consists of ordered pairs (a,b)(a,b) such that

b≡±2a(modn).b\equiv\pm2a\pmod n.

A vertex i∈V(Gn)i\in V(G_n) can be viewed as representing the difference ±i\pm i, and thus, an edge (a,b)(a,b) corresponds to the equi-difference codeword 0,a,2a0,a,2a. A loop in GnG_n represents the special equi-difference codeword 0,n/3,2n/30,n/3,2n/3, which arises only when 3∣n3\mid n. The graph GnG_n decomposes as a collection of disjoint cycles. This follows from the fact that the edge condition defines a permutation on the vertex set VV. By identifying xx and −x-x, the set VV represents the non-zero elements of Zn\mathbb{Z}_n up to sign. The edge condition b≡±2a(modn)b\equiv\pm2a\pmod n acts as multiplication by 22 in this quotient space. Since by assumption nn is odd, the number 22 is invertible modulo nn. Consequently, the mapping a↦±2a(modn)a\mapsto\pm2a\pmod n is a bijection, guaranteeing that every vertex in GnG_n has an in-degree and out-degree of exactly 11. Equivalently, the reachability between vertices can be formalized by the relation a∼ba\sim b if and only if b≡±2ra(modn)b\equiv\pm2^r a\pmod n for some integer rr. Because 22 is invertible in Zn\mathbb{Z}_n, this satisfies the properties of an equivalence relation. The resulting equivalence classes partition VV into distinct connected components, which strictly correspond to the disjoint cycles of the graph.

Definition 2. Given any odd natural number nn, we let O(n)\mathcal{O}(n) denote the number of cycles of odd length in GnG_n, where a loop is considered a cycle of length 11. For convenience, we put O(1)=0\mathcal{O}(1)=0.

For example, G21G_{21} has three cycles: (7)(7), (3,6,9)(3,6,9), and (1,2,4,8,5,10)(1,2,4,8,5,10), and hence O(21)=2\mathcal{O}(21)=2. The cycle (7)(7) is considered a loop.

Recall that for any two distinct codewords x≠yx\ne y, the condition Δ(x)∩Δ(y)=∅\Delta(x)\cap\Delta(y)=\varnothing must be satisfied. To construct as many codewords as possible, we aim to maximize the number of disjoint vertex subsets, where each vertex subset SS falls into one of the following three categories:

  • (a) ∣S∣=1|S|=1: the induced subgraph is a loop,

  • (b) ∣S∣=2|S|=2: the induced subgraph is a single edge,

  • (c) S={a,b,c}S=\{a,b,c\} such that a+b≡±c(modn)a+b\equiv\pm c\pmod n.

Note that for any odd integer nn, the graph GnG_n contains at most one loop. Since each equi-difference codeword corresponds to an edge in GnG_n, constructing an optimal code C∈CACe(n)C\in\mathrm{CAC}^{e}(n) amounts to finding a maximal matching in GnG_n, excluding the loop (recall that a matching MM in a graph G=(V,E)G=(V,E) is a subset of the edge set EE such that no two distinct edges in MM share a common vertex). Moreover, since each vertex i∈V(Gn)i\in V(G_n) represents the difference ±i\pm i, a tight equi-difference code C∈CACe(n)C\in\mathrm{CAC}^{e}(n) exists if and only if there is a matching that covers all vertices of GnG_n. Given that GnG_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≥3n\ge3, a tight equi-difference code C∈CACe(n)C\in\mathrm{CAC}^{e}(n) exists if and only if 3∤n3\nmid n and O(n)=0\mathcal{O}(n)=0, or 3∣n3\mid n and O(n)=1\mathcal{O}(n)=1.

The reader might wonder why the 33 divisibility of nn plays a role. This is due to the existence of the special equi-difference codeword (0,n/3,2n/3)(0,n/3,2n/3) which of course only occurs if 3∣n3\mid n.

References

  1. [1]J-P. Allouche, M. Stipulanti, J-Y. Yao, Doubling modulo odd integers, generalizations, and unexpected occurrences, Math Intelligencer 48 (2026), 177–192. (p. 14).arxiv.org/abs/2504.17564
  2. [2]T.M. Apostol, Introduction to Analytic Number Theory, Undergraduate Texts in Mathematics, Springer-Verlag, New York-Heidelberg, 1976. (p. 3).
  3. [3]L.A. Bassalygo and M.S. Pinsker, Limited multiple-access of a nonsynchronous channel, Probl. Inf. Transm. 19 (1983), No. 4, 92–96. (p. 1).
  4. [4]K. Belabas and H. Cohen, Numerical algorithms for number theory—using Pari/GP, Mathematical Surveys and Monographs, 254, American Mathematical Society, Providence, RI, 2021. (p. 23).
  5. [5]A. Boripan, S. Jitman, SRIM and SCRIM factors of x^n + 1 over finite fields and their applications, Discrete Math. Algorithms Appl. 13 (2021), no. 1, Paper No. 2050098, 20 pp. (p. 11).arxiv.org/abs/1909.03826
  6. [6]A. Boripan, S. Jitman and P. Udomkavanich, Self-conjugate-reciprocal irreducible monic factors of x^n − 1 over finite fields and their applications, Finite Fields Appl. 55 (2019), 78–96. (p. 11).
  7. [7]F. E. Brochero-Martinez, C.R. Giraldo Vergara and L. de Oliveira, Explicit factorization of x^n − 1 ∈ F_q[x], Des. Codes Cryptogr. 77 (2015), 277–286. (p. 11).
  8. [8]M. Deaconescu, An identity involving multiplicative orders, Integers 8 (2008), A9, 5 pp. (p. 14).DOI
  9. [9]S.R. Finch, G. Martin and P. Sebah, Roots of unity and nullity modulo n, Proc. Amer. Math. Soc. 138 (2010), 2729–2743. (p. 24).DOI
  10. [10]H.-L. Fu, Y.-H. Ho and K.S. Shum, Optimal conflict-avoiding codes of odd length and weight three, Des. Codes Cryptogr. 72 (2014), 289–309. (pp. 3, 4, 6, and 9).
  11. [11]K. Girstmair, The mean value of the digits of 1/p, preprint (2026). https://arxiv.org/pdf/2607.13663 (p. 10).
  12. [12]K. Girstmair, Mean values and variances of the digits of 1/p, preprint (2026). https://arxiv.org/pdf/2602.29930 (p. 10).
  13. [13]K. Girstmair, Digit frequencies and class numbers, preprint (2026). https://arxiv.org/pdf/2606.04512 (p. 15).
  14. [14]L. Györfi and I. Vajda, Constructions of protocol sequences for multiple access collision channel without feedback, IEEE Trans. Inform. Theory 39 (1993), No. 5, 1762–1765. (p. 1).DOI
  15. [15]C. Hooley, Artin’s conjecture for primitive roots, J. Reine Angew. Math. 225 (1967), 209–220. (p. 15).
  16. [16]L.-C. Hsia, H.-C. Li and W.-L. Sun, Certain diagonal equations and conflict-avoiding codes of prime lengths, Finite Fields Appl. 92 (2023), Paper No. 102298, 21 pp. (pp. 8 and 9).DOI
  17. [17]L.-C. Hsia, H.-C. Li and W.-L. Sun, Conflict-avoiding codes of prime lengths and cyclotomic numbers, IEEE Trans. Inform. Theory 70 (2024), 6834–6841. (pp. 5, 9, and 24).arxiv.org/abs/2302.01487
  18. [18]S. Hu, M.-S. Kim, P. Moree and M. Sha, Irregular primes with respect to Genocchi numbers and Artin’s primitive root conjecture, J. Number Theory 205 (2019), 59–80. (pp. 15, 16, 18, 19, 21, and 22).arxiv.org/abs/1809.08431
  19. [19]K. F. Ireland and M. I. Rosen, A Classical Introduction to Modern Number Theory, second edition, Graduate Texts in Mathematics 84, Springer, New York, 1990. (p. 24).
  20. [20]S. Jitman, Good integers and some applications in coding theory, Cryptogr. Commun. 10 (2018), 685–704. (p. 20).DOI
  21. [21]S. Jitman, Good integers: a structural review with applications to polynomial factorization and algebraic coding theory, Int. J. Math. Math. Sci. 2026, Paper No. 5836749, 18 pp. (p. 20).
  22. [22]H.W. Lenstra, jr., P. Moree and P. Stevenhagen, Character sums for primitive root densities, Math. Proc. Cambridge Philos. Soc. 157 (2014), 489–511. (p. 15).
  23. [23]V. I. Levenshteĭn, Conflict-avoiding codes and cyclic triple systems, Problemy Peredachi Informatsii 43 (2007), No. 3, 39–53. (p. 1).DOI
  24. [24]R. Lidl and H. Niederreiter, Finite Fields, Encyclopedia of Mathematics and its Applications 20, Addison-Wesley Publishing Company, Advanced Book Program, Reading, MA, 1983. (p. 11).
  25. [25]R. Lidl and H. Niederreiter, Introduction to Finite Fields and their Applications, Cambridge University Press, Cambridge, 1986. (p. 11).
  26. [26]J. L. Massey and P. Mathys, The collision channel without feedback, IEEE Trans. Inform. Theory, 31 (1985), No. 2, 192–204. (p. 1).DOI
  27. [27]P. Mathys, A class of codes for T active users out of N multiple-access communication system, IEEE Trans. Inform. Theory, 36 (1990) No. 6, 1206–1219. (p. 1).
  28. [28]M. Mishima and K. Momihara, A new series of optimal tight conflict-avoiding codes of weight 3, Discrete Math. 340 (2017), 617–629. (p. 2).DOI
  29. [29]K. Momihara, Necessary and sufficient conditions for tight equi-difference conflict avoiding codes of weight three, Des. Codes Cryptogr. (2007) 45, 379–390. (p. 2).DOI
  30. [30]P. Moree, On the divisors of aᵏ + bᵏ, Acta Arith. 80 (1997), 197–212. (pp. 20 and 24).
  31. [31]P. Moree, On primes p for which d divides ordₚ(g), Funct. Approx. Comment. Math. 33 (2005), 85–95. (p. 20).
  32. [32]P. Moree, On the distribution of the order and index of g (mod p) over residue classes - I, J. Number Theory 114 (2005), 238–271. (p. 16).DOI
  33. [33]P. Moree, Artin’s primitive root conjecture – a survey, Integers 12A (2012), No. 6, 1305–1416. (pp. 4 and 20).arxiv.org/abs/math/0412262
  34. [34]P. Moree, Near-primitive roots, Funct. Approx. Comment. Math. 48.1 (2013), 133–145. (p. 15).
  35. [35]P. Moree and P. Sgobba, Prime divisors of ℓ-Genocchi numbers and the ubiquity of Ramanujan-style congruences of level ℓ, J. Number Theory 251 (2023), 147–184. (p. 22).DOI
  36. [36]P. Moree and B. Sury, Primes in a prescribed arithmetic progression dividing the sequence {aᵏ + bᵏ}∞ₖ₌₁, Int. J. Number Theory 5 (2009), 641–665. (p. 21).DOI
  37. [37]Q. A. Nguyen, L. Györfi, and J. L. Massey, Constructions of binary constant-weight cyclic codes and cyclically permutable codes, IEEE Trans. Inform. Theory 38 (1992), No. 3, 940–949. (p. 1).DOI
  38. [38]F. Rodier, Minoration de certaines sommes exponentielles binaires, Coding theory and algebraic geometry (Luminy, 1991), 199–209, Lecture Notes in Math. 1518, Springer, Berlin, 1992. (p. 17).DOI
  39. [39]W.-L. Sun, A note on prime index of a certain subgroup in Fₚ*, unpublished preprint, https://arxiv.org/abs/2310.04527. (p. 22).
  40. [40]B. S. Tsybakov and A. R. Rubinov, Some constructions of conflict-avoiding codes. Problemy Peredachi Informatsii 38, (2002), No. 4, 24–36. (p. 1).DOI
  41. [41]S.S. Wagstaff, Jr., Pseudoprimes and a generalization of Artin’s conjecture, Acta Arith. 41 (1982), 141–150. (pp. 15 and 16).DOI
  42. [42]K. Wiertelak, On the density of some sets of primes - IV, Acta Arith. 43 (1984), 177–190. (p. 20).DOI
  43. [43]K. Wiertelak, On the density of some sets of primes p, for which η|ordₚ(a), Funct. Approx. Comment. Math. 28 (2000), 237–241. (p. 20).
  44. [44]S.-L. Wu and H.-L. Fu, Optimal tight equi-difference conflict-avoiding codes of length n = 2ᵏ ± 1 and weight 3, J. Combin. Des. 21 (2013), 223–231. (pp. 4 and 13).
  45. [45]Y. Zhang, Y.-H. Lo and S. W. Wong, Optimal strongly conflict-avoiding codes of even length and weight three, Des. Codes Cryptogr. 79 (2016), 367–382. (p. 1).DOI

Paper details

vlnc:W_pneuzh8h
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Not recorded for this paper

View statement
Looking for related papers…
Contents