SAN DIEGO -- After a flawless start, Eugene Chen, of Pleasanton, came up one answer short of making the finals of the American Mathematical Society's national contest on Thursday.

Chen, 16, an Amador Valley High School junior, was one of 10 students chosen to compete based on a national qualifying test. Working with pen and paper in a game show-type format, the students competed for nearly $30,000 in cash and prizes in the "Who Wants to Be a Mathematician?" contest. They answered timed multiple choice questions in calculus, algebra, geometry and math history.

Tied for the lead in his semifinal group after six questions, Chen just missed reaching the contest's final round, answering a difficult word problem incorrectly. He finished behind Shyam Narayanan, of Kansas, and Alex Wang, of New Mexico, who both advanced to the finals.

But Chen didn't go home empty-handed; by virtue of his third-place finish in the semifinal round, he won $1,000 for himself and another $1,000 for Amador Valley High's math program, as well as a college-level calculus book.

"It was a tough group," said Mike Breem, the competition's co-founder and host. "Even though he missed the finals by a question, he wasn't bummed out ... He's only a junior, so he might have another shot at it next year."

Before flying back to the Bay Area, Chen accompanied fellow contestants and their families to an awards luncheon, where they met with prominent mathematicians.

The national competition, held in San Diego during the society's Joint Mathematics Meetings with the Mathematical Association of America, was broadcast live on the Internet. Math clubs across the country were encouraged to tune in and play along.

Calvin Deng, a senior at the North Carolina School of Science and Mathematics, was the contest's winner, taking home the grand prize of $10,000, which he split with his school.

Contact Jeremy Thomas at 925-847-2184 or follow him at Twitter.com/jet_bang.