The ratio of the Bs0 and B+ fragmentation fractions fs and fu is studied with Bs0→J/ψφ and B+→J/ψK+ decays using data collected by the LHCb experiment in proton-proton collisions at 7, 8, and 13 TeV center-of-mass energies. The analysis is performed in bins of B-meson momentum, longitudinal momentum, transverse momentum, pseudorapidity, and rapidity. The fragmentation-fraction ratio fs/fu is observed to depend on the B-meson transverse momentum with a significance of 6.0σ. This dependency is driven by the 13 TeV sample (8.7σ), while the results for the other collision energies are not significant when considered separately. Furthermore, the results show a 4.8σ evidence for an increase of fs/fu as a function of collision energy.