Haruhi Suzumiya
© GabSL/DeviantartHaruhi Suzumiya fan art
Apparently part of the solution to a difficult mathematics problem has been available for years on a 4chan board about anime. The anonymous author provided it as a tip about how to best watch a non-linear series.

The amusing story where anime and science intersected was brought to light by Robin Houston, a computer scientist and mathematician on Twitter.

The problem in question comes from the math field of combinatorics and deals with permutations. A permutation is an act of changing the arrangement, especially the linear order, of a set of items. For instance, the numbers 1, 2 and 3 can be arranged in six different ways, i.e. there are six possible permutations for three elements. A superpermutation is a string that contains all possible permutations of a set as sub-strings.

In more practical terms, say there is a series of several episodes labeled not chronologically, but absolutely arbitrary. And the series is so bad that you have no way of determining the correct order from the content. If you are determined to watch them the right way at least once, you can start a marathon, playing the episodes again and again until all possible order variants are complete.

The example may seem hypothetical, but it was not for fans of an anime called "The Melancholy of Haruhi Suzumiya", the first season of which contains 14 episodes. It was broadcast in a non-chronological order - as an acknowledgment of its theme of time travel - so fans of the anime have a fad of rearranging and rewatching it again and again.

So in September 2011 somebody asked on 4chan how long it may take if one were to watch Haruhi in every possible order. And another anonymous poster offered a solution - thus solving the problem of the lower bond for the minimal length of a superpermutation. Jay Pantone, a mathematician at Marquette University, translated the 4chan solution into a formal layout for mathematicians and believes the proof holds up.

Incidentally, last month Australian hard sci-fi author and mathematician Greg Egan (one of his books is called Permutation City by the way) wrote up a suggestion on finding the largest possible number for any given superpermutation problem. So now Pantone and Houston as well as other researchers are working on a formula that combines Egan's work and the 4chan solution into a cohesive formula.

If found, it won't have any immediate practical use, Pantone told The Verge. But "that's the beautiful thing about math, is that anyone can understand the questions," he added.

As for the answer to the original Haruhi marathon question, Pantone said one would have to watch no less than 93,884,313,611 episodes and no more than 93,924,230,411 episodes to accomplish the task. Good luck with that.