The mystery of whether there is a natural resonance between music and our brains, as I mentioned in a post last week, brings up an even deeper question: whether mathematics itself is neurologically innate, giving the mind (or some minds) direct access to the structure of the universe. Thinking about that recently led me back to one of Oliver Sack’s most astonishing essays. It appeared in his collection The Man Who Mistook His Wife for a Hat, and is about two twins, idiot savants who appeared to have an almost supernatural ability to quickly tell if a number is prime. Prime numbers are those that cannot be broken down into factors -- smaller numbers that can be multiplied together to produce the larger one. They have been described as the atoms of the number system. 11 and 13 are obviously prime while 12 and 14 are not. But with larger numbers our brains are quickly flummoxed. Is 7244985277 prime? I just typed the digits by twitching my fingers along the top row of my keyboard. To test the number by hand I would have to start at the beginning of the number system and begin trying out the possible divisors. There are shortcuts to avoid testing every single one. We know 2 can’t be a factor since 7244985277, like all primes, is odd. For the same reason we can rule out all even factors. And you only have to test factors up to the square root of a number. (The factors of 100 are 2 x 50, 4 x 25, 5 x 20, and 10 x 10. Testing beyond 10 would be redundant.) There are ways to pare down the calculations even further. Numbers ending in 5 can't be prime, and there are tricks for seeing if a number is divisible by 3, 7, 0r other small factors. Mathematicians have come up with other more sophisticated algorithms. But that still leaves long nights of mental drudgery. It took until the late 1800s for mathematicians to dig out a prime as large as 39 digits -- and another half a century to get up to 44 digits. Now I can check my number with the Primomatic (it can be broken into 2659 and 2724703). Testing by hand a number that long could take anywhere from hours to months of arithmetic. In Sacks’s account, the twins -- who were variously diagnosed as autistic, psychotic, or severely retarded -- are said to have been able to perceive within minutes whether a 20-digit number, twice as long as the one I came up with, was prime. It makes for a wonderful story with allusions to Borges and the great neuropsychologist Alexander Luria. Sacks tells how he met the twins in 1966 at a state mental hospital. With IQs of 60 they could barely do simple arithmetic, he reports, but they were already known as calendrical calculators. Given a date far in the future they could quickly tell you what day of the week it would fall on.