It was a weekend of math for young students at University of New Brunswick's Fredericton campus.

Almost 400 Grade 7, 8 and 9 students took part in an hour-long math exam. They were among 1,200 students taking the test across the province.

"To see these teenagers in an environment where it's cool to love mathematics, it's just wonderful," said University of New Brunswick mathematics professor Maureen Tingley, who organized this year's event.

'This is math you'd never find in a classroom' —Coby Prosser,16, math camp participant

The annual competition began 28 years ago, to encourage would-be mathematicians.

Students who do well on the exam have a chance to be invited to a special three-day math camp for Grade 10 and 11 students. Math camp ran at UNB this weekend too.

"This is math you'd never find in a classroom. Like, it's theoretical math rather than equation math," said Coby Prosser, 16, a North Carleton High School student who returned for a second year at camp.

It's also "neat" to be in a room where everyone loves the subject, he said.

Kathryn Lynch of Miramichi attended the camp for this first time.

She hears the words 'geek' and 'nerd' from her non-math friends.

"Yep. All the time," she said.

The annual competition and camp encourage students to continue with mathematics beyond school, said Tingley.

Students are taught that learning math and its logic will help them in whatever they decide to do with lives," said Tingley.

"Oh yes. We have a student coming back this summer from Cambridge where he's getting a PhD and we first met him through the competitions," she said. 

It also benefits the math program at UNB, she said.