  Bose-Einstein condensation (BEC) of an ideal gas is investigated, beyond the
thermodynamic limit, for a finite number $N$ of particles trapped in a generic
three-dimensional power-law potential. We derive an analytical expression for
the condensation temperature $T_c$ in terms of a power series in
$x_0=\epsilon_0/k_BT_c$, where $\epsilon_0$ denotes the zero-point energy of
the trapping potential. This expression, which applies in cartesian,
cylindrical and spherical power-law traps, is given analytically at infinite
order. It is also given numerically for specific potential shapes as an
expansion in powers of $x_0$ up to the second order. We show that, for a
harmonic trap, the well known first order shift of the critical temperature
$\Delta T_c/T_c \propto N^{-1/3}$ is inaccurate when $N \leqslant 10^{5}$, the
next order (proportional to $N^{-1/2}$) being significant. We also show that
finite size effects on the condensation temperature cancel out in a cubic
trapping potential, e.g. $V(\mathbi{r}) \propto r^3$. Finally, we show that in
a generic power-law potential of higher order, e.g. $V(\mathbi{r}) \propto
r^\alpha$ with $\alpha > 3$, the shift of the critical temperature becomes
positive. This effect provides a large increase of $T_c$ for relatively small
atom numbers. For instance, an increase of about +40% is expected with $10^4$
atoms in a $V(\mathbi{r}) \propto r^{12}$ trapping potential.
