Differential production cross sections of J/$\psi$ and $\psi$(2S) charmonium and $\Upsilon$(nS) (n = 1, 2, 3) bottomonium states are measured in proton-proton collisions at $\sqrt{s} =$ 13 TeV, with data collected by the CMS detector at the LHC, corresponding to an integrated luminosity of 2.3 fb$^{-1}$ for the J/$\psi$ and 2.7 fb$^{-1}$ for the other mesons. The five quarkonium states are reconstructed in the dimuon decay channel, for dimuon rapidity $|y| <$ 1.2. The double-differential cross sections for each state are measured as a function of $y$ and transverse momentum, and compared to theoretical expectations. In addition, ratios are presented of cross sections for prompt $\psi$(2S) to J/$\psi$, $\Upsilon$(2S) to $\Upsilon$(1S), and $\Upsilon$(3S) to $\Upsilon$(1S) production.
The $B_\mathrm{c}^+$ meson is observed for the first time in heavy ion collisions. Data from the CMS detector are used to study the production of the $B_\mathrm{c}^+$ meson in lead-lead (PbPb) and proton-proton (pp) collisions at a center-of-mass energy per nucleon pair of $\sqrt{s_{\mathrm{NN}}} =$ 5.02 TeV, via the $B_\mathrm{c}^+ \to (J/\psi\to\mu^+\mu^-)\mu^+\nu_\mu$ decay. The $B_\mathrm{c}^+$ nuclear modification factor, derived from the PbPb-to-pp ratio of production cross sections, is measured in two bins of the trimuon transverse momentum and of the PbPb collision centrality. The B$_\mathrm{c}^+$ meson is shown to be less suppressed than quarkonia and most of the open heavy-flavor mesons, suggesting that effects of the hot and dense nuclear matter created in heavy ion collisions contribute to its production. This measurement sets forth a promising new probe of the interplay of suppression and enhancement mechanisms in the production of heavy-flavor mesons in the quark-gluon plasma.