A search for narrow resonances in dielectron and dimuon invariant mass spectra has been performed using data obtained from proton-proton collisions at root s = 13 TeV collected with the CMS detector. The integrated luminosity for the dielectron sample is 2.7 fb(-1) and for the dimuon sample 2.9 fb(-1). The sensitivity of the search is increased by combining these data with a previously analyzed set of data obtained at root s = 8 TeV and corresponding to a luminosity of 20 fb(-1). No evidence for non-standard-model physics is found, either in the 13 TeV data set alone, or in the combined data set. Upper limits on the product of production cross section and branching fraction have also been calculated in a model-independent manner to enable interpretation in models predicting a narrow dielectron or dimuon resonance structure. Limits are set on the masses of hypothetical particles that could appear in new-physics scenarios. For the Z'(SSM) particle, which arises in the sequential standard model, and for the superstring inspired Z'(psi) particle, 95% confidence level lower mass limits for the combined data sets and combined channels are found to be 3.37 and 2.82 TeV, respectively. The corresponding limits for the lightest Kaluza-Klein graviton arising in the Randall-Sundrum model of extra dimensions with coupling parameters 0.01 and 0.10 are 1.46 and 3.11 TeV, respectively. These results significantly exceed the limits based on the 8 TeV LHC data. (C) 2017 The Author. Published by Elsevier B.V.