It's a chess algorithm.
This is a very interesting question. Somehow, chess seems related to math. There are at least 2 groups which you are only allowed to join if you are a member of AoPS (Art of problem solving), which is a major math website. This isn't the right place to ask how music relates to math, but it is the right place to ask how chess relates to math.