A two-distance code is a set of equal-length words whose distinct pairs have Hamming distance in
a prescribed two-element set. Write for the largest size of such a code of length
over a
-symbol alphabet when the permitted distances are 2 and 4 (Djaljapayan
et al. 2026ab). No linearity or finite field
structure is assumed.
Djaljapayan et al. (2026b) proved that
for
or 4 and every
. For every integer
, Djaljapayan et al. (2026a) proved the
same formula when
where
is the ceiling function. The optimal threshold
is the least
for which the formula holds for every
. For
it lies between
and
. Djaljapayan et al. (2026b)
report ChatGPT assistance with constructing independent verification software.
For distances measured in Euclidean space, the corresponding objects are Euclidean two-distance sets. Their cardinality bounds differ from those for Hamming-space codes (Bu et al. 2026).