If you're in the Midwest, your summer might have a very crunchy soundtrack: The sounds of hordes of cicadas emerging from the Earth, chirping and whizzing and sexing and dying after more than a decade underground. That isn't to say that people around the rest of the United States aren't hearing the same thing on a smaller scale.

[This beetle’s butt is basically a machine gun]

That's because cicadas spend most of their long, long lives (the longest of any known insect) underground, and some species emerge periodically -- once every 13 or 17 years. When broods sync up, things get loud -- which is what's happening right now in the Midwest.

In the latest video from It's Okay to be Smart, Joe Hanson explains why you should be more in awe of the insects than annoyed with them: They're actually doing some pretty impressive math -- though it's not on purpose -- and it's a really smart evolutionary tactic.

[Fruit flies can apparently tell time]

By coming out in literal droves, cicadas are able to survive -- er, at least for the handful of weeks it takes them to reproduce -- even though basically everything wants to eat them. Birds can go to town on the emerging cicadas and still leave plenty over to lay eggs.

They're coming. (Daniel Hulshizer/AP)

That's where the prime numbers come in. Why 13 and 17 years? By living life in the prime, cicadas can minimize the number of times their big debut coincides with the birth year of a predator. If they'd "picked" a number divisible by another number, they'd link up with predators who were born at those intervals way more often -- and the predators could adapt to follow cicada lifecycles even more closely, shifting so that they had their babies right when cicadas showed up to provide an endless food source.

[Video reveals the incredible acrobatic feats (and occasional face plants) of a pouncing praying mantis]

But 17 years (and even 13 years) is a long time for just about any bird or lizard, so they've got no chance of hitching their carts to the cicada's brood. And by coming out every 17 years instead of every 16, the cicadas also avoid sync-ups with predators who have 2-year and 4-year reproductive cycles, too.

That cycle keeps 13- and 17-year broods apart, too. The ones meeting up this year in the Midwest won't sync up again until 2236.

In case you want more cicada science, here's Gross Science's Anna Rothschild explaining the fungus that makes cicadas lose their butts -- and turn into "salt-shakers of death":

Nature is beautiful.

Read More:

This beetle’s butt is basically a machine gun

These caffeine-addicted beetles are using bacteria to ruin all of our coffee

Say hello to the dementor wasp. It turns cockroaches into zombies.

This bug’s pick up line to females draws a biting response: Death

This scientist rates and describes insect stings as if they were fine wines