We present a simple physical mechanism that can account for the observed st
ellar mass spectrum for masses M* greater than or similar to 0.5 M-.. The m
odel depends solely on the competitive accretion that occurs in stellar clu
sters where each star's accretion rate depends on the local gas density and
the square of the accretion radius. Zn a stellar cluster, there are two di
fferent regimes depending on whether the gas or the stars dominate the grav
itational potential. When the cluster is dominated by cold gas, the accreti
on radius is given by a tidal-lobe radius. This occurs as the cluster colla
pses towards a rho proportional to R-2 distribution. Accretion in this regi
me results in a mass spectrum with an asymptotic Limit of gamma = -3/2 (whe
re Salpeter is gamma = -2.35). Once the stars dominate the potential and ar
e virialized, which occurs first in the cluster core, the accretion radius
is the Bondi-Hoyle radius. The resultant mass spectrum has an asymptotic li
mit of gamma = -2 with slightly steeper slopes (gamma approximate to -2.5)
if the stars are already mass-segregated. Simulations of accretion on to cl
usters containing 1000 stars show that, as expected, the low-mass stars acc
umulate the majority of their masses during the gas-dominated phase whereas
the high-mass stars accumulate the majority of their masses during the ste
llar-dominated phase. This results in a mass spectrum with a relatively sha
llow gamma approximate to 3/2 power law for low-mass stars and a steeper po
wer law for high-mass stars -2.5 less than or similar to gamma less than or
equal to -2. This competitive accretion model also results in a mass-segre
gated cluster.