# Given a formal power series ,decide whether there exists a polynomial the series satisfies and if it exists,how to write it down?

Given a formal power series $$y(x)=\sum_{i=0}^{\infty} a_i x^i$$ Is there an algorithm that decides whether there exists a polynomial$$ P(x,y)=p_n(x)y^n+p_{n-1}(x)y^{n-1}+\cdots+p_0(x)=0,p_j(x)\in F[x]$$the series satisfies and if it exists,how to write it down?This is relevant because if an element of $\mathbf{Z}[[X]]$ is algebraic over

$\mathbf{Q}(X)$, then its reduction modulo any prime $p$ will be algebraic

over $\mathbf{F}_p(X)$.