I've been trying to solve a Chinese remainder theorem problem using modulo arithmetic. The example on  is a case where there is only 3 equations (and therefore 3 unknowns). In the wikipedia example, it seems as though I am expressing the 1st unknown in terms of the 2nd unknown, and then plug this into the 1st equation to get 2 equations (old and new) for the 2nd unknown. Equate equations 2 and 3 to get 3rd unknown in terms of equation 2, then substituting this into the 2nd new equation. I'm sorry if that seems quite confusing, but that's how I feel currently (confused).  In my case, there are 6 unknowns,  (i) $x = 1$ (mod $2$) = $1 + 2.p_{1}$ (mod $2$)   (ii) $x = 2$ (mod $3$) = $2+3.p_{2}$ (mod $3$)   (iii) $x = 3$ (mod $4$) = $3 + 4.p_{3}$ (mod $4$)   (iv) $x = 4$ (mod $5$) = $4+5.p_{4}$ (mod $5$)   (v) $x = 5$ (mod $6$) = $5 + 6.p_{5}$ (mod $6$)   (vi) $x = 0$ (mod $7$) = $7.p_{6}$ (mod $7$)  I have been able to get $x = 5 + 6_p{2}$ (mod $2$), but have been unable progress further. Any pointers in the right direction would be much appreciated! THanks
32668
$$\begin{align*} x&amp;\equiv 1\pmod2\\ x&amp;\equiv 2\pmod3\\ x&amp;\equiv 3\pmod4\\ x&amp; \equiv 4\pmod5\\ x&amp;\equiv 5\pmod6\\ x&amp;\equiv 0\pmod7\\ \end{align*}$$  So the solution says we can eliminate $x\equiv 5(\bmod6)$ because the first two cases cover it, but I don't really know how it does. How do we solve it in cases like this where the moduli are not mutually relatively prime.
110629
$$ \begin{cases} x\equiv 2 \pmod{3}\\ x\equiv 1 \pmod{4}\\ x\equiv 3 \pmod{5} \end{cases} $$  $ n_1=3\\ n_2=4\\ n_3=5\\ N=n_1 * n_2 * n_3 =60\\ m_1 = 60/3 = 20\\ m_2 = 60/4 = 15\\ m_3 = 60/5 = 12\\ gcd(20,3)=1=-20*1+3*7\\ gcd(15,4)=1=-15*1+4*4\\ gcd(12,5)=1=12*3-5*7\\ x=-20*2-15*1+12*3\equiv -19 \equiv 41 \pmod{60}\\ $  The above is what I've tried so far. Can someone tell me where I'm going wrong? It's my first time doing this and looking at the explanation and examples for the Chinese Remainder Theorem makes my head want to explode.
46053
I'm not sure if it's correct, but what I have so far is; $$21n^5 + 10n^3 + 14n ≡ (1 + 0 - 1) ≡ 0 \mod 5$$ but I'm having trouble solving it in $\bmod 3$. I have: $$21n^5 + 10n^3 + 14n ≡ (0 + (?) + 2),$$ I'm not sure how to solve the $10n^3$ part of the congruence in $\mod 3$. Also, if I have any mistakes please let me know.
73445
Find an integer having the remainders $2,3,4,5$ when divided by $3,4,5,6$, respectively.   My work:  We consider the congruences $x \equiv 2 \pmod 3$, $x \equiv 3 \pmod 4$, $x \equiv 4 \pmod 5$, $x \equiv 5 \pmod 6$. We can reduce this further to $x \equiv 2 \pmod 3$, $x \equiv 3 \pmod 4$, $x \equiv 4 \pmod 5$. We have  $N_1 = 4 \cdot 5 = 20 \implies 20 x_1 \equiv 1 \pmod{3} \implies 2x_1 \equiv 1 \pmod{3} \implies x_1 \equiv 2 \pmod {3}$  $N_2 = 3 \cdot 5 = 15 \implies 15x_2 \equiv 1 \pmod{4} \implies -x_2 \equiv 1 \pmod{4} \implies x_2 \equiv 3 \pmod {4}$   $N_3 = 3 \cdot 4 = 12 \implies 12 x_3 \equiv 1 \pmod{5} \implies 2x_3 \equiv 1 \pmod{5} \implies x_3 \equiv 3 \pmod {5}$  Now,  \begin{align*} \bar x &amp;= a_1 N_1 x_1 + a_2 N_2 x_2 + a_3 N_3 x_3 \\ &amp;= 3 \cdot 20 \cdot 2 + 4 \cdot 15 \cdot 3 + 5 \cdot 12 \cdot 3 \\ &amp;= 480 \equiv 0 \pmod {3 \cdot 4 \cdot 5} \end{align*}  Is this correct, or is something wrong in my work? I don't like how I have $0$ remainder.
120574
So I have seen the similar question and answers on here for $x^4 +1$, but I am having trouble extending anything there to this polynomial... I understand it is fairly trivial with Galois theory, but my class has just barely covered Field Extensions, so suffice it to say we have no Galois theory to play with.  I managed to prove it for the primes such that $p \equiv 1, 7 \pmod 8$, by noting that $2$ is a square modulo those primes and thus $x^4 - 2x^2 +1 = (x^2 -1 + 2qx)(x^2 - 1 - 2qx)$ for those $\mathbb{Z}_p$... however, trying to get a similar result for $3 \pmod 8$ and $5 \pmod 8$ has been stumping me for a long time, I am having a hard time making $q^2 = -1$ and $q^2 = -2$ give me something factorable...  I guess the worst part of all of this is that I don't think this solution is even particularly enlightening, in terms of abstract algebra. It's really just some number theory trickery. I don't think my course has prepared me theoretically for this problem, does anyone have an elementary approach to it?
58424
Calculate without a calculator: $$\left [ 3 \right ]^{2014^{2014}}\mod 98$$   I know I have to use Euler's Theorem. As a hint it says I might need to use the Chinese Remainder theorem too. I know how both of these work theoretically.  For example I can calculate $5^{256} \mod 13$ with Euler's Theorem. But these large numbers throw me off, especially the double power of 2014.  I started of like this for the Chinese Remainder: $$98 = 2*7^{2}\\ \left [3  \right ]^{2014^{2014}} \mod 2 \\ \left [3  \right ]^{2014^{2014}} \mod 49 \\$$  Now calculate both: $$\left [3  \right ]^{2014^{2014}\mod \phi_{(2)} = 2} \equiv  \left [3  \right ]^{0} \equiv 1  \mod 2$$ That was lucky. I fail at mod 49.  Applying Euler's Theorem on 2014^2014 (since ([3]^2014)^2014 seems even more impossible) gives the following:  $$\phi _{(49)} = 42\\ 2014 = 47*42+40\\ 2014^{2014} = 2014^{42^{47}}*2014^{40}\equiv 2014^{40} \mod 49$$  (That doesn't really work without a calculator either.) And what now, applying Euler's Theorem again doesn't work, and I can't do it in my head either.  Is my approach right? Did I do something wrong?  Please point me in the right direction. I'm also open to entirely different solutions.
57988
I was working on number theory homework, and this problem was the second part to  problem.  Let $a,b,c,d,m$ be constants and $n$ and $k$ be coprime such that there are infinitely many values of $x$ that satisfy  $$ax+b=mn$$ $$cx+d=mk$$  Find the values of $ad-bc$ such that the above is true.   Now, according to the answer suggested above, these equations are true if $n \equiv b/m\pmod a,$ and $k \equiv d/m\pmod c,$ but I can't really find any insight on how to find the values of $x$ that would help with this part of the problem.
21445
For example: $$7x \equiv 1 \pmod{31} $$ In this example, the modular inverse of $7$ with respect to $31$ is $9$. How can we find out that $9$? What are the steps that I need to do? Update If I have a general modulo equation: $$5x + 1 \equiv 2 \pmod{6}$$ What is the fastest way to solve it? My initial thought was: $$5x + 1 \equiv 2 \pmod{6}$$ $$\Leftrightarrow 5x + 1 - 1\equiv 2 - 1 \pmod{6}$$ $$\Leftrightarrow 5x \equiv 1 \pmod{6}$$ Then solve for the inverse of $5$ modulo 6. Is it a right approach? Thanks.
77243
I'm trying to learn how to use the Chinese Remainder Theorem (CRT), and in order to give some context:  We search for all $x ∈ Z$, where $Z$ is the set of integers.  $x≡a_1\pmod{m_1}$  $x≡a_2\pmod{m_2}$  ...  $x≡a_k\pmod{m_k}$  The easy case (which I can solve) is if all $m_i$, where $i=1,2,...,k$ are pairwise coprime.  Example:  $x≡4\pmod 5$  $x≡5\pmod 6 $  $x≡3\pmod 7$  Then the first equation is satisfied iff $x=4+5s$, for some $s ∈ Z$.  These $x$ also satisfy the second equation iff $4+5s≡_6 5 ↔ -s≡_6 1 ↔ s=-1+6t$, for some $t ∈ Z$. Thus $x=4+5(-1+6t)=-1+30t$.  Lastly, these $x$ also satisfy the third equation iff $-1+30t ≡_7 3 ↔ 2t ≡_7 4 ↔ t ≡_7 2 ↔ t = 2+7n$, for some $n ∈ Z$. Thus $x=59+210n$.  Now to my issue, I have the problem:  $x≡2\pmod 4$  $x≡3\pmod 5$  $x≡5\pmod 6$  Here $\gcd(4,6)=2$, so they are not coprime and I don't know how to solve this. Can someone please solve it and explain why the problem becomes more difficult to solve when $m_i$ are not pairwise coprime.
48820
I stumbled across this problem  Find $\,10^{\large 5^{102}}$ modulo $35$, i.e. the remainder left after it is divided by $35$  Beginning, we try to find a simplification for $10$ to get: $$10 \equiv 3 \text{ mod } 7\\ 10^2 \equiv 2 \text{ mod } 7 \\ 10^3 \equiv 6 \text{ mod } 7$$ As these problems are meant to be done without a calculator, calculating this further is cumbersome. The solution, however, states that since $35 = 5 \cdot 7$, then we only need to find $10^{5^{102}} \text{ mod } 7$. I can see (not immediately) the logic behind this. Basically, since $10^k$ is always divisible by $5$ for any sensical $k$, then: $$10^k - r = 5(7)k$$ But then it's not immediately obvious how/why the fact that $5$ divides $10^k$ helps in this case. My question is, is in general, if we have some mod system with $a^k \equiv r \text{ mod } m$ where $m$ can be decomposed into a product of numbers $a \times b \times c \ \times ...$, we only need to find the mod of those numbers where $a, b, c.....$ doesn't divides $a$? (And if this is the case why?) If this is not the case, then why/how is the solution justified in this specific instance?
23395
So, a question in Elementary Number Theory by David M. Burton:     Problems 4.4      2(a) Using congruences, solve the diophantine equation 4x + 51y = 9       Hint: $4x \equiv 9(mod \ 51) $ gives $ x = 15 +51t$, whereas $ \ 51y \equiv 9 (mod \ 4)$ gives $y = 3+4s $. Find the relation between $s$ and $t$ From this hint, I substitute $ x = 15 +51t$ and $y = 3+4s$ in the given equation $4x + 51y = 9$ to get the relation $s = -t-1$ and using which I can get the solutions $ x = 15 + 51t, \ y =-1-4t$ But we know that the solutions of $ax \equiv b (mod \ n)$ is equivatent to the solutions of the diophantine equation $ax -ny = b$, so, solutions of $4x \equiv 9(mod \ 51) $ is equivalent to solutions of the equation $4x-51y=9$ whereas, solutions of $51y \equiv 9(mod \ 4) $ is equivalent to solutions of the equation $-4x+51y=9$ Now, my question is: as, the above equations $4x-51y=9$ and $-4x+51y=9$ are different, then what is the point of substituting $ x = 15 +51t$ (solution of $4x-51y=9$) and $y = 3+4s $ (solution of $-4x+51y=9$) in the given equation $4x+51y=9$ to find a relation between $t$ and $s$ ? Isn't it absurd as $ x = 15 +51t$ and $y = 3+4s $ are solutions of two different equations? Can anyone please explain this? PS: I did it like this $4x \equiv 9(mod \ 51) $ gives $ x = 15 +51t$ and by substituting it in $4x+51y=9$ we get $y=-1-4t$
52847
I found two examples that I'd like to understand:  Example 1: Find $112358132134 \mod 9$.  Solution is: $1+1+2+3+5+8+1+3+2+1+3+4 \mod 9 = 7 \mod 9 = 7$  Example 2: Find $62831853 \mod 11$.  Solution is: $(-6)+2+(-8)+3+(-1)+8+(-5)+3 \mod 11 = -4 \mod 11 = 7$  My question is: Based on what property we sum the digits of the number ( as Example 1) or subtract (as Example 2)?
26708
I'm currently learning how to find the inverse of a modulo with the Extended Euclid Algorithm and I stumbled upon a problem when finding an inverse when the $m&gt;p$ as for $m \equiv 1 \pmod{p}$  For example, in $$ 240x \equiv 1 \pmod{17} $$ what is the inverse? What are the steps to find it?
69034
Show that there is no solution to the congruence $x^2\equiv3\bmod5$.   I'm not sure if the fact that the only numbers divisible by $5$ are those ending in $0$ or $5$ will help&hellip;
80585
Consider the case that  $c = a \cdot b \mod p$  where $p$ is a known prime and $0 &lt; a &lt; p$ and $0 &lt; b &lt; p$ are unknown integers numbers. Furthermore, some bits on the value of $c$ are known.  Q1: Can an attacker learn some bits of $a$ using this information?  The question is based on the following non-modular example:  $a = x_1 \cdot 2^z + x_0$   and   $b = x_2 \cdot 2^z + x_3$  gives the product:  $a \cdot b = x_1x_22^{2z} + (x_0x_2+x_1x_3)2^z + x_0x_3$  Then if anyone knows the $z$ least significant bits of $a \cdot b$ (the product $x_0x_3$), then some of the divisors of $x_0x_3$ is equal to $x_0$, allowing to bound the possible values of $x_0$ to the possible divisors of $x_0x_3$.  Q2: Can this non-modular analysis be applied to the modular one ?
27631
Use the modulo version of the quadratic formula and Euler's criterion to decide if the following has a solution or not.  $2x^2+5x+8 \equiv 0\pmod{37}$  I'm not sure how I would use what was being asked of me to decide if this has a solution or not, but I have came to the conclusion that it does not, because I plugged in every possible answer $0-36$, and none of them were congruent to zero.  The way people have answered the question, isn't exactly the way I need.  I have made some progress, but I'm not exactly sure how to finish:  $2x^2+5x+8 \equiv 0\pmod{37}$  $x^2+21x+4\equiv0\pmod{37}$  $x^2+58x+841\equiv837\pmod{37}$  $(x+29)^2\equiv23\pmod{37}$  I know that if $p$ is an odd prime and $p$ doesn't divide $a$, then $x^2\equiv a\pmod{p}$ has a solution or no solution depending on whether $a^\frac{p-1}{2}\equiv 1  \space\space \text{or}\space -1\pmod{p}$.  This is where I get stuck.  Can someone help me from here?  I have a feeling this problem has no solutions, so could someone also explain to me what to do if a problem like this did have solutions.
8402
I have figured out a (long, and tedious) way to do it. But I was wondering if there is some sort of direct correlation or another path that I completely missed.  My attempt at the program was as follows:   A number of the form, $8k + 7 = 7 (mod 8)$. That is, we are looking for integers a, b, c such that $a^2 + b^2 + c^2 = 7 (mod 8)$.   LONG and TEDIOUS way: $$(8k)^2 = 0 (mod 8)$$ $$(8k+1)^2 = 1 (mod 8)$$ $$(8k+2)^2 = 4 (mod 8)$$ $$(8k+3)^2 = 1 (mod 8)$$ $$(8k+4)^2 = 0 (mod 8)$$ $$(8k+5)^2 = 1 (mod 8)$$ $$(8k+6)^2 = 4 (mod 8)$$ $$(8k+7)^2 = 1 (mod 8)$$  That is, using three of these modulo there is no way to arrive at  $$a^2 + b^2 + c^2 = 7 (mod 8)$$