The best coders are like gifted maths students, way ahead when they are still wearing a nappy.
I work inhouse at a company without any other IT staff in what is mostly an operations role, but has included some basic development to resolve problems that aren't fixable via off the shelf software. I wrote a quite substantial bit of code at one point, and after many, many changes I discovered a problem with it which I couldn't figure out.
I asked for some help, not having any other IT staff I asked for anybody with a math background, especially in algebra. This turned up one ~80 something year old lady who did algebra at school who hasn't been retired because she'd be bored and lonely at home on her own. She missed her calling as a teacher, and is utter death on even minor mistakes. Despite not even knowing how to use a computer, she successfully debugged the code, and highlighted all of my mistakes (including things error correction in the compiler had quietly dealt with). She then actually simplified a section with a more elegant way of resolving the problem, and wrote some code to deliver some extra functionality people had asked about.
And yeah, when I say didn't know how to use a computer? I mean it. She had the entire codebase printed on paper. And when I say highlighted mistakes I do mean with a highlighter, or underlined with red pen. And when I say she "wrote code", yes, I do mean with a pen. She still won't use a computer.
Lessons that should be learned from this IMO: Somebody proficient in advanced math can also write code pretty easily and more attention should probably be paid to teaching students math concepts than rote memorization of the times table. Secondly, if a not quite senile 80 year old woman can write perfect code on paper, then i'm not entirely clear about why it should be impossible that students be tested this way.