A Fairfax County high school junior would could multiply three digit numbers in his head before entering kindergarten has placed second in a nationwide mathematics competition involving 365,000 students.

The W. T. Woodson High School student, Randall Dougherty, goes to school early, in the mornings to work on the school's computer and gets all A's (except for one B in English) while usually doing less than an hour of homework at night.

Dougherty, an unassuming prodigy of relatively few words, had an almost perfect paper on a three-hour test of mathematical reasoning and creativity called the Sixth U.S.A. Mathematical Olympiad, which was held May 3.

In an earlier round in the competition, sponsored by the Mathematical Association of America, Dougherty also scored second in the country.

When he is working a problem, Dougherty explained, he usually looks for "a trick solution, something that would make it real simple. Then if I can't find one, I just work my way through."

"The elegant solutions are almost always the simple ones," he continued. "I get a good feeling out of doing it."

As a result of the tests, Dougherty will be part of the American team of eight students at the International Mathematical Olympiad in Belgrade, Yugoslavia, in July. All are male and all attend public schools.

Last year he tied for fourth place on the U.S. Olympiad test, and was a member of the American team that went to the international contest in Austria. The Americans finished third, behind Russia and Britain.

The top scorer on the U.S. Olympiad test both this year and last was Mark Kleiman, 16, a junior at Stuyvesant High School in New York City. Kleiman had a perfect paper both years.

Dougherty, the son of a Navy captain, has lived in six different states and attended classes in six different school systems. According to his mother, Judy, a real estate agent, he could multiply three- and four-digit numbers in his head when he was only 4 or 5, and since then has raced through everything mathematical set before him.

The family moved to Fairfax County last year, and as a sophomore Dougherty took all the advanced mathematics courses that Woodson High offers for seniors. This year he studied differential equations and multivariable calculus at George Mason University, but is still taking all his nonmathematics courses at Woodson.

Despite its difficulty, Olympiad test requires knowledge of only algebra and geometry. Calculus is not necessary or even useful but its problems do call for creative proofs that require rigorous logic and reasoning. "It's a matter of ingenuity and the method of approach," Dougherty explained, "as well as the solution itself."

In the first round of the nationwide mathematics contest this year four other students from the Washington area also scored among the top 100 (out of 365,000 students who took it.) They were Allen G. Gibbs, of Gonzaga High School in Washington; Lorenzo Sadun, of Bethesda-Chevy Chase High; Marshall Brinn of Northwood High in Silver Spring; and Ehud Reier of T.S. Wootton High in Rockville.

"I really think some of the teachers are intimidated by Randy," said Andre Samson, a mathematics teacher at Woodson. "He's very unassuming and never dominates, and when other students have a problem in math, he helps them. Sometimes they huddle around him . . .

"You know, our school is getting a lot of glory from Randy," Samson added, "but there probably will never be anyone like him here again. He's a once in a lifetime (student)."