Perturbative quantum chromodynamic prediction for the heavy quark fragmentation function