TOPICS
Search

Two-Distance Code


A two-distance code is a set of equal-length words whose distinct pairs have Hamming distance in a prescribed two-element set. Write A_q(n,{2,4}) for the largest size of such a code of length n over a q-symbol alphabet when the permitted distances are 2 and 4 (Djaljapayan et al. 2026a,b). No linearity or finite field structure is assumed.

Djaljapayan et al. (2026b) proved that

 A_q(n,{2,4})=1+(n; 2)

for q=3 or 4 and every n>=6. For every integer q>=5, Djaljapayan et al. (2026a) proved the same formula when

 n>=[max(2q+1,(17+sqrt(8q^2+96q-95))/2)],

where [x] is the ceiling function. The optimal threshold is the least N for which the formula holds for every n>=N. For q>=26 it lies between 2q-1 and 2q+1. Djaljapayan et al. (2026a) report preliminary ChatGPT proof checking. Djaljapayan et al. (2026b) report ChatGPT assistance with mathematical cross-checks and verification code.


See also

Codeword, Error-Correcting Code, Hamming Distance

Explore with Wolfram|Alpha

References

Djaljapayan, V.; Lin, Y.-C. R.; and Yu, W.-H. "Asymptotically Sharp Length Thresholds for q-ary Codes with Distances 2 and 4." 22 Oct 2026a. https://arxiv.org/abs/2610.30613.Djaljapayan, V.; Yu, W.-H.; and Lin, Y.-C. R. "The Ternary and Quaternary Cases of the {2,4}-Distance Code Conjecture." 22 Oct 2026b. https://arxiv.org/abs/2610.30615.

Cite this as:

Weisstein, Eric W. "Two-Distance Code." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/Two-DistanceCode.html

Subject classifications