The formula I found:
$$\sum_{i=1}^{k} a_{i}b_{i}b^{`}_{i} (\mod m_{i})$$
where:
$b_{i} = \frac{M}{m_{i}}$
$b_{i}^{`} = b_{i}^{-1} (mod m_{i})$
And for example:
$$x \equiv -7 \mod 13$$ $$x \equiv 39 \mod 15$$
$M = 13*15 = 195$
$b_{1} = 13$
$b_{2} = 15$
$b_{1}^{`} = \frac{1}{13} mod 13? = \frac{1}{13}?$
$b_{2}^{`} = \frac{1}{15} mod 15? = \frac{1}{15}?$
It would make $x = (a_{1} mod 13) + (a_{2} mod 15) = -7 + 9 = 2$, which is wrong. What am I missing? Maybe the formula is wrong?