He worked it out with a pencil!
An algorithm.
A reptile dysfunction
Someone who solves a problem you didn't know you had in a way you don't understand.