I remember once while in graduate school at the University of Wisconsin staying at my office until 4 a.m. Stumbling through the hall bleary-eyed on my way home, I came upon a little gnome of a man who, as if it were the middle of the day, began questioning me about my results in a kindly yet most energetic way. Who should be haunting those empty halls at that hour, except janitors? I was awake enough to realize that it was Paul Erdos, one of the most curious (in both senses), prolific and insightful mathematicians of this century. It's not surprising that Erdos would often remark that a mathematician was a machine for turning coffee into theorems. Toward the end of his life he even partook of amphetamines to keep his mental machinery churning into the wee hours.

Such eccentricity in the men who study circles and numbers is only part of the story of mathematicians Erdos and John Nash, the subjects of the new biographies "My Brain Is Open," "The Man Who Loved Only Numbers" and "A Beautiful Mind." But for many, the eccentricity may be the most intriguing part.

Science writer Bruce Schechter's "My Brain Is Open" is a mathematical biography of Erdos, born in 1913 in Hungary to academic parents. Erdos was cosseted by a mother who had just lost her other two children to scarlet fever and educated by a father who early on taught him about prime numbers and infinite sets. Both influences were life-defining. In later years he related how he independently discovered the notion of negative numbers at the age of 3 but didn't butter his own toast until he was 20.

Schechter sets the background to his story by mentioning the enormous contributions of other Hungarians, among them John von Neumann, Leo Szilard and Edward Teller, to 20th century science. Most, like Erdos, were (nonobservant) Jews. He describes how the very young Erdos met regularly with his intellectual pals at Budapest's Statue of the Anonymous to discuss mathematics, an early communal habit that presaged Erdos' collaborationist approach to writing mathematical papers. Later, he would cut such a broad swath across 20th century mathematics that mathematicians all over the world refer to their "Erdos number"--1 if they collaborated with him on a paper, 2 if they collaborated with someone who collaborated with him and so on.

One of the ambitions of Schechter's book is to describe the mathematical accomplishments of this short, celibate, seemingly frail man and to integrate them into the history of mathematics (and, to an extent, of the times generally). Thus Schechter discusses the proofs of the infinitude of primes and the irrationality of the square root of 2 before bringing up Erdos' generalization of Chebyschev's theorem, which won him his doctorate as a second-year undergraduate.

As are most of the problems that Erdos considered, the theorem is easy to state. The Russian mathematician Pafnuty Lvovitch Chebyschev had shown that between any number (N) and twice the number (2N) there was always a prime number. Erdos simplified the proof and showed that (provided N is at least 7) there were always at least two primes between N and 2N and that they had certain other properties as well. His concern with clarity in a proof led him to his notion of the Book Proof, the one that revealed the essence of the matter in as elegant and transparent a manner as possible.

Although the strategy of combining details of Erdos' life and work with mathematical generalities is sometimes successful, it often makes for bumpy transitions. In a few pages the book may skip between Pythagoras, some incident in Budapest, a precocious proof by the young Carl Friedrich Gauss (a great 19th century mathematician) and an anecdote involving the wife of one of Erdos' countless hosts.

Smoother, albeit less comprehensive, "The Man Who Loved Only Numbers," by Paul Hoffman, former editor of Discover magazine, tells essentially the same story as the Schechter book. He cites many of the same informants, among them the mathematicians Andrew Vasonyi, Erdos' boyhood friend, and Ron Graham, his de facto steward and friend.

The considerable appeal of both these books derives in large part from the anecdotes about Erdos that have circulated for decades in the mathematical community. Among these are his idiosyncratic vocabulary ("epsilons" for small children, "bosses" for wives and "Supreme Fascist" for God, in whom he did not believe); his lightning-fast perspicacity (overhearing a discussion of a problem in an unknown field of mathematics and coming back with the solution in a few minutes); his peripatetic lifestyle (without a permanent academic appointment, house, car or bank, he traveled the world constantly with two small suitcases, rarely staying anywhere for longer than a week or two); his befriending and encouraging of young mathematicians; his deportation problems with the State Department during the McCarthy era; his worldly helplessness; and, of course, his unrelenting obsession with mathematics.