Let A1,...,Ar be linear partial differential operators in N variables, with constant coefficients in a field K of characteristic 0. With A := (A1,...,Ar), a polynomial u is A-harmonic if Au = 0, that is, A1u = ··· = Aru = 0. Denote by mi the order of the first nonzero homogeneous part of Ai (initial part). The main result of this paper is that if r ≤ N, the dimension over K of the space of A-harmonic polynomials of degree at most d is given by an explicit formula depending only upon r, N, d, and m1,...,mr (but not K) provided that the initial parts of A1,...,Ar satisfy a simple generic condition. If r > N and A1,...,Ar are homogeneous, the existence of a generic formula is closely related to a conjecture of Fröberg on Hilbert functions. The main...