Mathematicians are bracing for a future when their profession could be mostly delegated to machines.