Heavy hadrons have been the focus of attention because of their worthwhile properties. So far the fragmentation function (FF) and total fragmentation probability (F.P) for heavy baryons and mesons have been calculated in quark model and diquark model in leading order of perturbative QCD. After the discovery of pentaquarks, their fragmentation probabilities were estimated based on the known measurementsof c or b quarks into mesons and baryons. In this note we calculate the direct fragmentation function of $$ \overline{c}\to {\varTheta}_c^0\left( uudd\overline{c}\right) $$ and $$ \overline{b}\to {\varTheta}_b^{+}\left( uudd\overline{b}\right) $$ processes in leading order of perturbative QCD, employing the diquark model with considerable precision. Consistent with such a process we set up the kinematics of the fragmentation of a heavy antiquark into a pentaquark such that the effect of the Fermi motion of the constituents is ignored. We show that using the diquark model for studying pentaquark can provide reasonably good theoretical results. The findings of this study accord with those in the previous studies.