It is known that exercise has a positive effect on BDNF (brain derived neurotrophic factor). BDNF has a positive effect on mood and cognitive abilities. What's the optimal way of exercising (frequency, duration, intensity level) when the goal is to maximize BDNF production?
Vigorous intensity (80% heart rate reserve) with long duration (40 min) offers the greatest probability of a significant BDNF elevation according to The Effects of Aerobic Exercise Intensity and Duration on Levels of Brain-Derived Neurotrophic Factor in Healthy Men study published in 2013.
The study does not give an answer to the optimal frequency of exercises. It is probably based on individuals' personal fitness level, because recovery should be taken into account as well.