← Lab /Crypto & theory

Certain second-order recurrence primes yield MDS and NMDS cyclic codes

Primes WSS(d) produce cyclic codes that are MDS in the reducible case and NMDS in the irreducible case

Crypto & theory arXiv 26 Mar 2026 Theory Theory

Published as “Second order Recurrences, quadratic number fields and cyclic codes”

Why it matters

The connection between WSS(d) primes and optimal cyclic codes could enable new algebraic-number-theoretic criteria for code existence and vice-versa.

Summary

The paper shows that for primes p where a second-order recurrence has the same period modulo p and p^2 (WSS(d) primes), the associated cyclic codes over F_p and Z_{p^2} are either MDS or NMDS, and it derives exact weight-distribution formulas linking the two codes. The results are proved theoretically and illustrated with computational tables for primes up to about 100, but the existence of such primes is known only for certain discriminants (e.g., none for d=5).

What they found 2

  1. For primes p ≡ 3 (mod 4) the constructed cyclic code C1 is an NMDS code with parameters [2(p+1),2,2p]_p and has a single nonzero weight.

    “Proposition 5. Let p > 5 be a prime ≡3 (mod 4). Then an associated cyclic code C1 from Proposition 3 is an NMDS code with parameters [2(p + 1), 2, 2p]p having only one-weight.”

  2. When C1 is a two-weight MDS code of length n ≤ p+1, the weight enumerators of C1 and its Z_{p^2} lift C2 are given by closed formulas.

    “Theorem 2. Assume that C1 is a two-weight MDS code whose length n is at most p + 1. Then An-1(C1) = n(p -1), An(C1) = (p -1)(p -n + 1), and An-1(C2) = n(p2 -1), An(C2) = (p2 -1)(p2 -n + 1).”

Caveats 3

  • For the classical Fibonacci case (d=5) no WSS(5) primes are known, limiting the applicability of the constructions to many discriminants.
  • Computations suggest that primes p for which a quadratic field is not p-rational are rare; e.g., Q(√5) is p-rational for all primes up to 10^14.
  • We conjecture based on numerical evidence that a = -2, b = 1. This fact is not needed in what follows.

What’s new here 4

  • Links the arithmetic property of WSS(d) primes (period equality modulo p and p^2) to the construction of MDS/NMDS cyclic codes.
  • Provides explicit constructions of extremal NMDS codes of length 2(p+1) for primes p ≡ 3 (mod 4).
  • Derives exact weight-distribution relationships between codes over F_p and their lifts over Z_{p^2}.
  • Shows that for any prime p there are infinitely many discriminants d such that p is a WSS(d)∗ prime.