The shape of the stellar initial mass function (IMF) of star clusters
has important consequences for the subsequent evolution of the cluster
s. In this paper we examine a star formation scenario in which the IMF
is determined. Thermal and dynamical instability result in the fragme
ntation of a parent gaseous protocluster cloud into cold, dense, low-m
ass cloudlets. Here we examine the subsequent evolution of the cloudle
ts as the cluster approaches virial equilibrium. Because of their inve
rse buoyancy,the cloudlets fall toward the central region of the proto
cluster cloud. During the infall, cohesive collisions cause the cloudl
ets' masses to grow. When the mass of a cloudlet exceeds the critical
mass for gravitational instability, M(G), it collapses to form a proto
stellar core. Its mass may continue to grow as a result of mergers wit
h remaining cloudlets until its UV emission heals and ionizes nearby c
loudlets. The most massive stars require many dissipative mergers and
so are preferentially formed in the cluster center, giving an initial
mass segregation consistent with the observed stellar distribution in
open clusters. Energy loss associated with the mergers also makes it m
ore likely that the newly formed clusters will remain gravitationally
bound even in the limit of inefficient star formation. The coagulation
process naturally leads to a power-law IMF. The range of power-law ex
ponents, x is found to be similar to those observed in both open and g
lobular star clusters in the Galaxy. Although limited by the use of a
direct N-body code to initial particle numbers N-i less than or simila
r to 10(4) and final number of stars less than or similar to 10(3), th
e results are found to be insensitive to N-i. for a constant value of
the initial covering factor of the stars. The results can therefore be
confidently applied to very rich clusters. The final slope of the IMF
also depends upon the initial velocity distribution and the ratio of
the initial mass of the cloudlets to M(G). The latter ratio may be a f
unction of the metallicity ([Fe/H]) and external pressure of the proto
cluster clouds so as to give the observed variation of x with [Fe/H] a
nd Galactocentric position among the Galactic globular clusters.