  Results are presented of a search for a heavy Majorana neutrino N$_\ell$
decaying into two same-flavor leptons $\ell$ (electrons or muons) and a
quark-pair jet. A model is considered in which the N$_\ell$ is an excited
neutrino in a compositeness scenario. The analysis is performed using a sample
of proton-proton collisions at $\sqrt{s}$ = 13 TeV recorded by the CMS
experiment at the CERN LHC, corresponding to an integrated luminosity of 138
fb$^{-1}$. The data are found to be in agreement with the standard model
prediction. For the process in which the N$_\ell$ is produced in association
with a lepton, followed by the decay of the N$_\ell$ to a same-flavor lepton
and a quark pair, an upper limit at 95% confidence level on the product of the
cross section and branching fraction is obtained as a function of the N$_\ell$
mass $m_{\text{N}_\ell}$ and the compositeness scale $\Lambda$. For this model
the data exclude the existence of N$_\text{e}$ (N$_\mu$) for
$m_{\text{N}_\ell}$ below 6.0 (6.1) TeV, at the limit where $m_{\text{N}_\ell}$
is equal to $\Lambda$. For $m_{\text{N}_\ell}$ $\approx$ 1 TeV, values of
$\Lambda$ less than 20 (23) TeV are excluded. These results represent a
considerable improvement in sensitivity, covering a larger parameter space than
previous searches in pp collisions at 13 TeV.
