and it was this-his ability to recite the first fifty digits of pi , to list all the countries of the world in alphabetical order , to calculate the square root of any number almost instantly- all this , he knew , was his ticket out of here .