  Suppose that $a_1(n),a_2(n),...,a_s(n),m(n)$ are integer-valued polynomials
in $n$ with positive leading coefficients. This paper presents Popoviciu type
formulas for the generalized restricted partition function
$$p_{A(n)}(m(n)):=#\{(x_1,...,x_s)\in \mathbb{Z}^{s}: all x_j\geqslant 0,
x_1a_1(n)+...+x_sa_s(n)=m(n) \}$$ when $s=2$ or 3. In either case, the formula
implies that the function is an integer-valued quasi-polynomial. The main
result is proved by a reciprocity law for a class of fractional part sums and
the theory of generalized Euclidean division.
