The partition function and specific heat of a system consisting of a f
inite number of bosons confined in an external potential are calculate
d in different spatial dimensions. Using the grand partition function
as the generating function of the partition function, an iterative sch
eme is established for the calculation of the partition function of sy
stem with an arbitrary number of particles. The scheme is applied to f
inite number of bosons confined in isotropic and anisotropic parabolic
traps and in rigid boxes. The specific heat as a function of temperat
ure is studied in detail for different number of particles, different
degrees of anisotropy and different spatial dimensions. The peak in th
e specific heat is taken as an indication of Bose-Einstein condensatio
n (BEG). It is found that the results corresponding to a large number
of particles are approached quite rapidly as the number of bosons in t
he system increases. For large number of particles, results obtained w
ithin our iterative scheme are consistent with those of the semiclassi
cal theory of BEC in an external potential based on the grand canonica
l treatment. (C) 1997 Elsevier Science Ltd.