The De Bruijn snake
The 64 hexagrams in a ring of 64 bits
Slide the window of six around the ring and check that no hexagram ever repeats.
There is a ring of exactly 64 yin/yang lines with an astonishing property: every window of 6 consecutive positions is a different hexagram. Sliding the window one position at a time, the 64 hexagrams each appear exactly once. It is the whole book compressed to the limit: 64 hexagrams in 64 bits, with nothing wasted. And it is not unique: there are 2²⁶ such rings; this one is the canonical one (the lexicographically minimal), built with the algorithm of Fredricksen and Maiorana (1978), while the object itself goes back to de Bruijn (1946).
the window reads 6 consecutive bits; going all the way around the ring, the 64 hexagrams pass by, each one once
The 64 squares are the 64 hexagrams (in Fu Xi order). Sliding the window lights them one by one, without repeating: once the loop is complete, all 64 are there.
There is a ring of 64 bits whose 64 windows of 6 consecutive bits are the 64 hexagrams, each exactly once; there are 2^26 such rings.
verificar_debruijn · source: de Bruijn, 1946The canonical construction used is that of Fredricksen and Maiorana: concatenating the Lyndon words in lexicographic order gives the minimal De Bruijn sequence.
verificar_debruijn · source: Fredricksen & Maiorana, 1978The types of claim and the full bibliography (APA) are in Foundations.
