  Let $r\geq 1$ be an integer, $\mathbf a=(a_1,\ldots,a_r)$ a vector of
positive integers and let $D\geq 1$ be a common multiple of $a_1,\ldots,a_r$.
We prove that, if a determinant $\Delta_{r,D}$, which depends only on $r$ and
$D$, with entries consisting in values of Bernoulli polynomials is nonzero,
then the restricted partition function $p_{\mathbf a}(n): = $ the number of
integer solutions $(x_1,\dots,x_r)$ to $\sum_{j=1}^r a_jx_j=n$ with $x_1\geq 0,
\ldots, x_r\geq 0$ can be computed in terms of values of Bernoulli polynomials
and Bernoulli Barnes numbers.
