You're basically describing the "Lumosity Principle;" that brain games will have a "spillover effect" into other cognitive areas. The only studies that demonstrate this effect seem to be those that are sponsored by Lumosity. There are even anecdotal studies that appear to demostrate that video games can be better at accomplishing this.
That said, there are substantial transfer effects for programmers solving puzzles, writing math equations and composing music. Why? Because programs are essentially puzzles. Because programs are mathematical in nature, especially the functional ones. Because programming is a creative endeavor, much like musical composition. Because the act of writing software is fundamentally a social one; you have to work with stakeholders, gather requirements, make plans, satisfy bosses, and exercise all manner of collaborative skills, technical and otherwise.
These kinds of activities have transfer effects because they are directly related to programming skills. It has to be the right kind of activities, in other words. But programming is like that; almost any sufficiently complex activity or human endeavor will achieve that.
Why Brain Training Doesn't Work