The ratios of the Bc(2S) to Bc, Bc(2S) to Bc, and Bc(2S) to Bc(2S) production cross sections are measured in proton-proton collisions at 13 TeV, using a data sample collected by the CMS experiment at the LHC, corresponding to an integrated luminosity of 143 fb−1. The three measurements are made in the Bc meson phase space region defined by the transverse momentum pT > 15 GeV and absolute rapidity |y| < 2.4, with the excited Bc(2S) states reconstructed through the Bc π+π−, followed by the Bc → J/ψπ+ and J/ψ → μ+μ− decays. The Bc(2S) to Bc, Bc(2S) to Bc, and Bc(2S) to Bc(2S) cross section ratios, including the unknown Bc(2S) → Bcπ+π− branching fractions, are (3.47 ± 0.63 (stat) ± 0.33 (syst))%, (4.69 ± 0.71 (stat) ± 0.56 (syst))%, and 1.35 ± 0.32 (stat) ± 0.09 (syst), respectively. None of these ratios shows a significant dependence on the pT or |y| of the Bc meson. The normalized dipion invariant mass distributions from the decays Bc(2S) → Bc π+π− are also reported.