There's beauty in numbers, says Andover High School math teacher Penny Carda. But how to show that to students?

Where she sees echoes of music and nature in the orderly advance of prime numbers — numbers that can be evenly divided only by the number 1 and themselves — students see drudgery. Where she sees magic in the rise and fall of the gaps between primes, they see a list of numbers.

Last school year, as Carda tried to find a way to pass on to her geometry students some of the fascination she has with math, she asked students to figure out all the prime numbers up to 500. Then she added that it would be pretty cool if someone could compose a song using the gaps between those numbers.

Fifteen-year-old Connor Boyer of Andover was the only student to take her up on it. And he doesn't even like math.

"I kind of prefer art and choir," he said. "Once I started, it was really hard but I kind of enjoyed it."

For Carda, who considers it her duty to make math come to life for students, the result was delightful, even beautiful. You can hear it at: www.youtube.com/watch?v=1eLH5AwzmK0.

"I was so pleased that one student would take me up on this," she said. "We're trying to get away from hand-feeding them. … If they can discover some of this on their own, they will own more of it."

Carda, who enters her 25th year of teaching this fall, said it's a struggle to make math relevant to many students.

"One of the hardest things about being a teacher is selling the product to kids," she said. "They want to know, if I invest time in this, what am I going to get out of it?"

The bigger meaning is clear to her. The logic of math helps people make decisions every day, to "think logically and sequentially, to take things step by step."

The proposal to compose music from the gaps between prime numbers was spur of the moment, Carda said.

"We were just talking about how to use this in real life. I talk to kids about that connection, and one connection is music. … I wanted to see how the pattern of prime numbers would play out in music."

Carda said that though she loves music, she is not musical. But, she said, the link between math and music is clear.

Her best math students often are in band, choir or orchestra. "They're disciplined, they're used to putting time and effort into seeing something through, they're used to concentrating," she said. "And so much math is in timing and rhythm."

Lists of prime numbers are easy to find on the Internet, but Boyer said he laboriously worked out his list of prime numbers by hand. A baritone in the school choir, he likes orchestra music and said that in the past he'd used a computer program to score songs.

So he figured out the gaps between his prime numbers, assigned "2" to "do" on the musical scale, "3" to "re," and so on, and plugged the information into the computer program.

He wasn't impressed.

"I thought it sounded horrific," he said. "It didn't sound good. So I … figured out all the prime numbers up to 1,000. It added a lot more notes to the composition."

The intervals between the prime numbers form the song's melody. Boyer added a repetitive bass line that gave the song some rhythm.

"It was a little bit weird, but it seemed to work," he said.

Carda was thrilled. "I don't think Connor was terribly convinced that it was beautiful, but I made all of my classes listen to it," she said. "I watched their faces. They thought it was cool."

She was impressed that Boyer figured his prime numbers up to 1,000. "He's a quiet student, but it shows so much maturity," she said. "One of the great factors to help you in life is work ethic. Even if you don't know [the answers], you put the effort in.

"You see so many people give up easily. When you have people stick with things and appreciate the process as well as the final product, that is really something we are trying to teach in school."

It was the first time Carda had asked her students to do a project like Boyer's. It's given her ideas.

"There are a lot of things I could do with perfect squares and the difference between them, and pi and irrational numbers don't get the attention they should," she said. "It would be wonderful to see what they could do with it."

As for Boyer, he said he still doesn't care for math. But the exercise made an impression on him.

"I think it gave me a different viewpoint on math," he said. "It was a lot more open than I expected. It was repetition and hard work, but I see it has a creative side, too."

Mary Jane Smetanka is a Minneapolis freelance writer.