新年好, everyone! It was Chinese New Year on Monday, starting the year of the monkey. I didn’t really pay attention last year, so I didn’t know that it had been the year of the goat. I also wasn’t aware until just now when I looked it up that next year will be the year of the rooster.

But, now that I know those facts, I know that the Chinese year starting in 2027 CE will be the year of the goat, the next one will be the year of the monkey, and the one after that will be the year of the rooster. That’s because this calendar works on a 12-year cycle, rotating through a fixed list of animals. (There’s more to it than that, but that’s what I’m going to think about). It goes as follows:

蛇 | snake |

牛 | ox |

馬 | horse |

兔 | rabbit |

龍 | dragon |

狗 | dog |

豬 | pig |

鼠 | rat |

羊 | goat |

虎 | tiger |

雞 | rooster |

猴 | monkey |

Now that I’ve looked up all twelve animals,I know that the rabbit comes four years before the goat, and I can work out that I went to Singapore in 1999, because I know I went more than five but less than 20 years ago and I can remember seeing a frankly unwise number of rabbits encaged underneath a massive rabbit statue.

So, it’s a pretty good calendar: time is divided up into periods of 12 years, and you can fairly easily work out when something happened in your lifetime because it’s very easy to estimate how many multiples of 12 years ago it happened, and by remembering where in the cycle you were.

*But what if we made it more complicated?*

At this point, if the Chinese zodiac is significant to you, I’ll have to ask you to set that aside for a moment because I’m going to mess about with it, for maths reasons.

虎 (tiger) always follows 羊 (goat). You never get 龍 (dragon) next. Maybe I’d like that to happen: every pair of signs in the zodiac should occur in the cycle the same number of times. Is that possible?

My first thought was that I’d need a de Bruijn sequence. Given an alphabet of $k$ symbols, a de Bruijn sequence is a cyclical sequence of those symbols containing every possible subsequence of length $n$. I’ve got $k = 12$ zodiac signs, and I’d like to see every sequence of $n=2$ symbols. Job done, right?

Well, I don’t want to see the same symbol twice in a row. As much as I love 猴 (monkey), I reckon it’d start to drag after a while. Since we’re looking at subsequences of length 2, if you’ve got a de Bruijn sequence, you can just remove repeated digits and get what we’re looking for.

That’s one way of doing it. What I actually did was to not realise that fact, and go about working out my own algorithm. It goes as follows:

- Start by writing out each cyclic permutation of the numbers $1$ to $n$ in a grid.
- Begin by writing the number $1$, then repeat:
- In the row corresponding to the last number you wrote down, write down the first number which hasn’t been crossed out, and then cross it out.
- The last number you write down will be a $1$, starting the cycle again.

For 5 symbols, that process looks like this:

This works for any number of symbols^{(citation needed)}, and you can construct a de Bruijn sequence from it by just doubling up the first occurrence of each symbol.

A nice thing about the grid presentation is that you can easily see that the sequence on $n$ symbols has length $n (n-1)$.

So I’m ready to put together my new calendar, upending centuries of careful observance for the sake of a mathematical whimsy. Here’s Python code which produces the sequence of years:

def cycle(seq): n = len(seq) nexts = {seq[i]: [seq[(i+j)%n] for j in range(1,n)] for i in range(n)} last = seq[0] while len(nexts[last]): yield last last = nexts[last].pop(0) sequence = list(cycle(['鼠','牛','虎','兔','龍','蛇','馬','羊','猴','雞','狗','豬'])) print(' '.join(sequence))

And that produces

鼠 牛 虎 兔 龍 蛇 馬 羊 猴 雞 狗 豬 鼠 虎 龍 馬 猴 狗 鼠 兔 蛇 羊 雞 豬 牛 兔 馬 雞 鼠 龍 羊 狗 牛 龍 猴 豬 虎 蛇 猴 鼠 蛇 雞 牛 蛇 狗 虎 馬 狗 兔 羊 豬 兔 猴 牛 馬 豬 龍 雞 虎 羊 鼠 馬 鼠 羊 牛 羊 虎 猴 虎 雞 兔 雞 龍 狗 龍 豬 蛇 豬 馬 牛 猴 兔 狗 蛇 鼠 猴 龍 鼠 雞 蛇 牛 雞 馬 虎 狗 馬 兔 豬 羊 兔 鼠 狗 羊 龍 牛 狗 猴 蛇 虎 豬 猴 馬 龍 虎 鼠 豬 雞 羊 蛇 兔 牛 豬 狗 雞 猴 羊 馬 蛇 龍 兔 虎 牛

This cycle has a period of $12 \times 11 = 132$ years – barring advances in medical science, nobody would see the whole thing. And could you work out when something happened just by knowing which sign was associated with the year and roughly how long ago it happened? No! I’ve ruined the best thing about the Chinese calendar.

In conclusion, if my new calendar were to be adopted, there’d be a lot more headaches, and pretty much no benefits.

You could also try introducing a parallel calendar based on an 11 year cycle (maybe something based on the solar cycle) or 13 (like the periodic cicadas) or some other number that has no common factors with 12.

John Conway’s stair counting method based on cycles.