Explicit expressions for restricted partition function $W(s,{\bf d}^m)$ and its
quasiperiodic components $W_j(s,{\bf d}^m)$ (called {\em Sylvester waves}) for a set of
positive integers ${\bf d}^m = \{d_1, d_2, ..., d_m\}$ are derived. The formulas are
represented in a form of a finite sum over Bernoulli and Euler polynomials of higher order
with periodic coefficients. A novel recursive relation for the Sylvester waves is
established. Application to counting algebraically independent homogeneous polynomial
invariants of the finite groups is discussed.