Number Theory - Modular arithmetic with complex numbers So I was looking at a problem that asked me to find an $x$ s.t $x^3 = -1 \pmod{199}$ given that $14^2 = -3 \pmod{199}$.
To do this I was given the hint to look at complex numbers so I did the following
$$2(-1)^{\frac{1}{3}} - 1 = \sqrt{-3} $$
so then I can say that
$$(-1)^{\frac{1}{3}} = (14 + 199 + 1)/2 = 107$$
which is indeed a solution to the problem.
I am looking for an explanation as to why I can do this and any additional information as to how to apply this trick to similar problems.
 A: $x^3 + 1 = (x + 1)(x^2 - x + 1)$ and note that $199$ is a Prime, so 
$x + 1 = 0 \ \pmod{199}$ or $x^2 - x + 1 = 0 \ \pmod{199}$.
The hint $14^2 = -3 \ \pmod{199}$ to find the root of $x^2 - x + 1$ since:
$x^2 - x + 1 = (x - \frac{1}{2})^2 + \frac{3}{4} = 0 \ \pmod{199}$
then 
$(2x - 1)^2 = -3 \ \pmod{199}$

p.s.
there are $3$ roots : $\{-1, 107, -106\}$
A: Let me try to explain in two steps the intervention of "complex numbers" in your problem:
1) Let $p$ be a prime $\neq 2, 3$ and $\mathbf F_p$ denote the field with $p$ elements. Convention: throughout, all the algebraic calculations will take place in a fixed algebraic closure $F$ of $\mathbf F_p$ ; to avoid confusion, the equality between two elements $a,b$ of $F$ will be written $a\equiv b$. Because  $p \neq 3$, the cubic roots of $1$ in $F^*$ form a cyclic group of order $3$; write $j$ for a generator of this group. Because $\mathbf F_p^{*}$ is cyclic of order $p-1$, $j \in \mathbf F_p^{*}$ iff $p \equiv 1 \pmod {3}$, wich is the case of $p=199$. Then the solutions of the equation $x^3 + 1\equiv (x+1)(x+j)(x+j^2) \equiv 0$  in $\mathbf F_{199}$ are $1, -j, -j^2$. It only remains to express $j, j^2$ in $\mathbf F_{199}$ using the hint $14^2\equiv -3$. For this, just notice that the usual relation $1+j+j^2 \equiv 0$ implies $3\equiv (2+j)(2+j^2)\equiv -(1+2j)^2$, so that $(1+2j)\equiv \pm 14$ and we get finally, just as in the answer of @Mudream, $-j\equiv 107, -j^2\equiv-106$ (depending on the choice of $j$)
2) The analogy with the complex 3rd roots of unity, with $j=(-1 + \sqrt -3)/2$, is more than an analogy. Introduce the complex quadratic field $\mathbf Q(j)$, whose ring of integers is $E:=\mathbf Z[j]$, the so called Eisenstein ring. It is known that $E $ is a UFD, hence, up to units (=invertible elements), we can do arithmetic in $E$ just as in $\mathbf Z$ up to sign. The irreducible (=prime) elements of $E$ up to units are of two kinds: (i) the rational primes $p\equiv -1\pmod {3}$ ;  (ii) the elements $\pi$  of $E$ whose norm (= product of complex conjugates) is $3$ or a rational prime $p\equiv 1 \pmod{3}$ (such as $199$). In this last case, using the norm, we can solve the congruence $x^3 +1 \equiv 0$ in $E/\pi E$ just as in $\mathbf Z /p\mathbf Z$, which explains the "analogy" with 1) .
A: If you are working in a ring and if $s^2=-3$ has a solution in the ring, then $x=(1+s)/2$ satisfies $x^3=-1$. The rules of algebra hold in general in any ring with obvious exceptions such as not always being able to divide by non zero elements such as $2$.
A: Given that $\sqrt{-3}=14$, this is easy: 
$x^3+1=0 \implies(x+1)(x^2-x+1)=0$. So $x=-1$, or $x^2-x+1=0$. Solving the quadratic:
$x=\dfrac{1\pm\sqrt{-3}}{2}=\dfrac{1\pm 14}{2}$
So $x\in\{-1,15/2,-13/2\} = \{198,107,93\}$.
