Measurement of the charm fragmentation function in D* photoproduction with ZEUS at HERA The charm fragmentation function was measured in D* photoproduction with the ZEUS detector at HERA using an integrated luminosity of 120 pb-1. The fragmentation function is presented versus z, the ratio of E + p_parallel of the D* meson and of the associated jet, where E is the energy and p_parallel, the longitudinal momentum relative to the jet axis. Jets were reconstructed using the k_T clustering algorithm and required to have a transverse energy larger than 9 GeV. The D* meson associated with the jet was required to have a transverse momentum greater than 2 GeV. The measurement is compared to different fragmentation models incorporated in leading-logarithm Monte Carlo simulations and a next-to-leading-order calculation. The results are similar to those from e+e- experiments.