Citation missing, but I've read a paper that claimed rather convincingly that you need a certain mindset both to be good at programming and to enjoy programming (unsurprisingly, this comes hand in hand). It's not really problem solving, it's rather a specific kind of structured thinking. It's the attention to detail and the will to think through every aspect of an issue, to find a complete solution. That's also a use…
I don't remember and wasn't able to find it either, but I know which study you're talking about. There was a professor who gave his intro CS students an exam where they were supposed to interpret code. Of course, most of them had no idea what they were reading. The statement "X = X + 1" is (as a mathematical equation) garbage, even though it's legitimate in a conventional CS context (whereby '=' represents assignment…
Actually it could be perfectly valid, depending on the context.
For example, if + denotes the boolean AND and 1 is true, then X = 1.