Polynomial has roots in any ring $\mathbb{Z}/n\mathbb{Z}$ but not in $\mathbb{Z}$

You need to know that, for $p$ an odd prime, if $x^2\equiv a\pmod p$ has a solution, with $(a,p)=1$, then $x^2\equiv a\pmod {p^k}$ has a solution for any $k$. This is shown via induction relatively easily for $p$ odd.

The case of powers of $2$ is a little harder. You actually need to start with $x^2\equiv a\pmod{8}$ before the induction works.


First of all I definitely don't want to compete with the answer by Thomas Andrews, it is definitely the answer, I just want to try and see whether it can be also done using Taylor series.

As he points out, powers of 2 are trickier. For odd $p$, we can proceed as follows.

We are given integers $x$ and $c$ with $a=x^2+cp$ and we are looking for $y$ with $y^2\equiv a\pmod{p^k}$. Thus we need $$ \sqrt a=\sqrt{x^2+cp}=x\sqrt{1+\frac{cp}{x^2}} $$ and my claim is that computing this analytically via power series expansion makes sense in $\mathbb Z/p^k$.

First, since $a$ is not divisible by $p$, neither is $x$, so $1/x$ (and then also $1/x^2$) "exists in $\mathbb Z/p^k$". More precisely, there is an integer $x'$ with $xx'\equiv1\pmod{p^k}$ and I will simply denote this $x'$ by $1/x$.

Let us now expand $x(1+\frac c{x^2}p)^{\frac12}$ into Taylor series treating $p$ as a variable: $$ x(1+\frac c{x^2}p)^{\frac12}=x\sum_{n=0}^\infty\binom{\frac12}n\left(\frac c{x^2}p\right)^n=x+\frac c{2x}p-\frac{c^2}{8x^3}p^2+\frac{c^3}{16x^5}p^3-\frac{5c^4}{128x^7}p^4+...+(-1)^{n+1}\frac{\binom{2n}nx}{2n-1}\left(\frac c{4x^2}\right)^np^n+... $$ (see e. g. Wikipedia). Now in fact $\frac{\binom{2n}n}{2n-1}$ is an integer (it is twice the $n-1$st Catalan number), and also $1/4$ can be replaced by an integer -- let us just denote by $1/4$ some integer $d$ with $4d\equiv1\pmod{p^k}$. So this series makes sense and converges in $\mathbb Z/p^k$ to a certain value $y$. Actually we just throw out all powers of $p$ starting from $p^k$ and obtain an integer $y$ (rememeber $1/x$ is also a notation for a certain integer). Then by the very construction $y^2\equiv a\pmod{p^k}$.

I admit I am too lazy to work out details for $p=2$ but one thing I can say is that if given a solution of $x^2\equiv a\pmod2$ I can find a solution of $x^2\equiv a\pmod 8$ then the higher powers of 2 can be treated similarly to the above: if $a=x^2+8c$ then $\sqrt a=x\sqrt{1+\frac{4cp}{x^2}}$ where $p=2$, and we can give sense to the expansion of $\sqrt{1+\frac{4cp}{x^2}}$ in $\mathbb Z/2^k$ since the resulting series will only have odd denominators (well, no denominators at all actually, as $1/x$ just denotes some integer).