Want to generate new ideas? Throw on your walking shoes. 

A recent study published in the Journal of Experimental Psychology by Stanford University researchers Marily Oppezzo, a doctoral student in education psychology, and Daniel Schwartz, a professor at the Stanford Graduate School of Education, found going for a walk, whether indoors or outdoors, can give the brain a dose of inspiration.

The research validates actions taken by some of the greatest leaders of our generation. Steve Jobs was known to take "thinking walks," Facebook founder Mark Zuckerberg regularly does business while walking around Facebook's campus, and President Obama often ends his workdays walking around the White House grounds with his Chief of Staff.

While many people have claimed to do their best thinking while walking, the researchers wanted to study whether it was the change of setting (getting outdoors) or the mere act of moving one's body that helped get the creative juices flowing. To determine this, they designed a series of experiments. One had participants walk outside while another had them walking on a treadmill facing a plain wall, and another had participants sitting at a desk.

Related: 9 Awesome Ways to Inspire Others

The researchers designed a number of creativity tests. One involved "divergent thinking," or brainstorming, where participants were asked to generate alternate uses for a given item. While researchers assumed those who walked outside would score higher than participants who were walking on a treadmill indoors, they found compared with sitting, any kind of walking boosted creativity by an average of 60 percent.

“On a treadmill facing a blank wall was still as effective as walking outside,” says Oppezzo, giving credence to the recent surge in popularity of treadmill desks.

What was also surprising was that participants retained their creativity boost for at least eight minutes after sitting down at a desk. "Those who sat after they walked were more creative than if they had never walked all," says Oppezzo. 

So, what happens to our brain when we walk? Oppezzo has a theory. "We have a filter in our brain that tells us what's a good [idea] and what's not, which is good in many tasks; you want to be able to say that's not a very relevant thought right now. But when you're brainstorming, you don't want to have that filter," she says. Walking may help to relax the filter, allowing for a free flow of ideas and imagination.

Related: 10 Strategies for Overcoming Creativity Block

While walking for four minutes was effective at boosting creativity during brainstorming tasks, it showed no benefits to "convergent thinking," a type of thinking that requires a single answer -- pinpointing a missing variable, for example.

When participants were given a list of three items (cottage, swiss and cake, for example) and were asked to find the word that applies to all of those items (cheese), those who were walking showed no improvement than those who performed the task while sitting. This suggests you shouldn't spend the entire working day walking, but should unshackle yourself from your desk when it comes to brainstorming tasks.

While not every office can bring treadmills into meeting rooms or host walking brainstorming meetings, Oppezzo hopes the study will improve the way companies think about movement. Providing a place for employees to walk, such as a groomed pathway outside the office or a hallway for pacing, are among ways companies can improve their physical surroundings to encourage walking. Even simple acts, such as encouraging employees to take five minutes to go for a walk before attending a brainstorming session, can result in more innovative solutions and a more productive meeting.

Related: If You Envision It, It Will Come