There are some basic tools missing from people's mental toolboxes. In many cases these are the same tools that likely they failed to instill in Math classes.
Reduction, breaking a problem into components or stages, then further down to individual steps is the key one they missed. Learning how to attack a problem and what strategies let you chop it into perl-syntax sized chunks is a tricky thing...
Further, multi-focus, the ability to keep the goal, the main loop of the program, the sub sections, and the individual line you are on all in your head at once seems to be a talent the best have.
I would like to point out that "Math class" is not the only place to learn these things. Music is another arena in which the skills necessary for programming may be learned. (Note this interesting comment along these lines.)
Like many other things, Music is separable into many layers: reading the notation, playing an instrument, writing music, conducting, etc. Moreover, each layer at one level may also be composed of sub-layers.
For example, you have to know the mechanics of playing your chosen instrument, may need to know how to read what's written, and if reading written music, must definitely know how to interpret the notation, in order to play music. Then, if you're playing with a group of musicians, you may need stay together by following the leader or perhaps by simply listening to the others at the same time you're playing.
(As an aside, it would be interesting to ask the monks how music has affected their programming. I don't mean give me a list of what you like to listen to, but not this either, as it is a little too abstract (though I like it). What I would like to see is discussion about what skills learned via music tranfer to programming.)