You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which can be rewritten by subtracting $x_1$ and dividing by $p_1$ to get
64
64
65
65
$$\begin{array}{rclr}
66
-
a_2 - x_1 &\equiv& x_2 p_1 &\pmod{p_2} \\\\
67
-
(a_2 - x_1) r_{12} &\equiv& x_2 &\pmod{p_2} \\\\
66
+
a_2 - x_1 &\equiv& x_2 p_1 &\pmod{p_2} \\
67
+
(a_2 - x_1) r_{12} &\equiv& x_2 &\pmod{p_2} \\
68
68
x_2 &\equiv& (a_2 - x_1) r_{12} &\pmod{p_2}
69
69
\end{array}$$
70
70
@@ -184,5 +184,7 @@ class Number {
184
184
* Modular scheme itself does not allow representing negative numbers. However, it can be seen that if we know that the absolute values our numbers are smaller than $p / 2$, then we know that it must be negative when the resulting number is greater than $p / 2$. The flag `can_be_negative` in this code allows converting it to negative in this case.
185
185
186
186
## Practice Problems:
187
+
188
+
*[Google Code Jam - Golf Gophers](https://codingcompetitions.withgoogle.com/codejam/round/0000000000051635/0000000000104f1a#problem)
187
189
*[Hackerrank - Number of sequences](https://www.hackerrank.com/contests/w22/challenges/number-of-sequences)
0 commit comments