In this article, a positive answer is given to the following question posed by Hayman [35, page 326]: if a polyharmonic entire function of order $k$ vanishes on $k$ distinct ellipsoids in the Euclidean space $\mathbb{R}^{n}$ , then it vanishes everywhere. Moreover, a characterization of ellipsoids is given in terms of an extension property of solutions of entire data functions for the Dirichlet problem, answering a question of Khavinson and Shapiro [39, page 460]. These results are consequences from a more general result in the context of direct sum decompositions (Fischer decompositions) of polynomials or functions in the algebra $A(B_{R})$ of all real-analytic functions defined on the ball $B_{R}$ of radius $R$ and center zero whose Taylor series of homogeneous polynomials converges compactly in $B_{R}$ . The main result states that for a given elliptic polynomial $P$ of degree $2k$ and for sufficiently large radius $R>0$ , the following decomposition holds: for each function $f\in A( B_{R})$ , there exist unique $q,r\in A(B_{R})$ such that $f=Pq+r$ and $\Delta^{k}r=0$ . Another application of this result is the existence of polynomial solutions of the polyharmonic equation $\Delta^{k}u=0$ for polynomial data on certain classes of algebraic hypersurfaces