A single-track Gray code of length is a cyclic Gray code of -bit words in which every column is a cyclic shift of the first. For prime the longest possible period is . Whether it is attained for every prime has been open since Hiltgen, Paterson and Brandestini introduced these codes in 1996, and optimal codes were known for primes . We show that a conjecture of Degni and Drisko (2007) on the reflected Gray code order of necklaces implies optimal single-track Gray codes for every prime. Their list of necklaces, conjecturally a Gray path for prime , closes into a Hamilton cycle of the necklace graph after explicit Pósa rotations, and such a cycle lifts to an optimal code. This implication is formalized in Lean 4. Together with computation it gives optimal single-track Gray codes for every odd prime : for explicit codes checked word by word by a program independent of the generator, and for , and codes obtained from the implication after the Degni-Drisko property was verified at these lengths by two independently written programs.

生成讲解博客的中文版本

生成AI智能校验的中文版本