The mathematician Maximillian Cohen is tormented by a severe migraine since he was a kid, and he uses many pills to reduce his painful headaches. He is a lonely man, and his only friend is his former professor Sol Robeson. Max has the following assumptions, which rules his life: (1) Mathematics is the language of nature; (2) Everything around us can be represented and understood from numbers; (3) If you graph the numbers in any system, patterns emerge. Therefore there are patterns everywhere in nature. Based on these principles, Max is trying to figure out a system to predict the behavior of the stock market. Due to his research, Max is chased by a Wall Street company with obvious interest in the results of his studies, and by a Chasidic Torah scholar, who believes that this long string of numbers is a code sent from God.