-1

I am not able to figure out why the reminder of $8^{30} / 7$ is same as that of $1^{30} / 7$. I know Euclid division $a=bq+r$ but I don't know modular arithmetic, so please explain without referring to modular arithmetic.

Thanks in advance.

user103816
  • 4,027

5 Answers5

8

By the binomial theorem, we have $$8^{30}=(7+1)^{30}=\sum_{k=0}^{30}\binom{30}{k}7^{30-k}\cdot 1^k=7\left(\sum_{k=0}^{29}\binom{30}{k}7^{29-k}\right)+1^{30}$$

mathlove
  • 151,597
  • Okkk. So they actually use binomial theorem for these type of questions. – user103816 Jul 28 '15 at 19:04
  • This method would work only when numerator is higher than the denominator. Suppose I have to find reminder of $5^{30}/7$ then could this method be used? – user103816 Jul 28 '15 at 19:39
  • Perhaps this could solved by changing $5^{30}$ to $25^{15}=(7*3+4)^{15}$. – user103816 Jul 28 '15 at 19:44
  • Or by writing $5^{30} = (7-2)^{30}$ – Asvin Jul 28 '15 at 19:45
  • @Asvin But that would require binomial theorem with negative coefficients. Could you explain in detail. – user103816 Jul 28 '15 at 19:49
  • @mathlove could you help me out with this problem. – user103816 Jul 28 '15 at 19:50
  • For 5 you can use that 7 is prime number fe. So from little Fermats theorem you got: $5^{7-1} = 1 ;\mathrm{mod}; 7 = 5^6 = 1 ;\mathrm{mod};7$. So now you just divide 30 by 6. 30 is divisible by 6 so your reminder is 1. – fho Jul 28 '15 at 19:50
  • @fho No Fermat theorem is too high level for me. – user103816 Jul 28 '15 at 19:52
  • @user103816: Can you make the $n$ concrete? (By the way, I think you already got the idea from the example $5^{30}$...) – mathlove Jul 28 '15 at 19:56
  • So then just write down modules of few powers. Let 5 be generator. $5^k = a_k (;\mathrm{mod};7)$ and $k = {1,2,3, ..., 6}$. You will end up with something like this ${5,4,6,2,3,1}$. As you can see there is 1 at the end of the sequence, so if you will continue with it you would end up with sequence that repeats ${5,4,6,2,3,1,5,4,6,2,3,1, ....}$ – fho Jul 28 '15 at 20:09
  • @fho Actually I wanted to ask this thing as another of for why is there cyclic pattern of reminders but I guess I have to study modular arithmetic in detail first. – user103816 Jul 28 '15 at 20:13
  • The cyclic pattern of remainders is quite simple to understand. If you repeatedly multiply by 5, you going to inevitably run out of numbers and return to a previous number. From there, it cycles on. – Tae Hyung Kim Jul 28 '15 at 20:16
  • @mathlove What do you mean by making $n$ concrete? It is $36^{321}$. I'm trying to solve this hypothetical problem. – user103816 Jul 28 '15 at 20:16
  • @user103816: I meant that I would like you to write a concrete example like $36^{321}$ (not general example like $36^n$). For the example, we have $36^{321}\equiv (36^3)^{107}\equiv (87\times 536+24)^{107}\equiv 24^{107}\equiv 24\cdot 24^{106}\equiv 24\cdot (24^2)^{53}\pmod{87}$. Now you should know how to continue. – mathlove Jul 28 '15 at 20:25
  • @thkim1011 I've asked it as another question here: http://math.stackexchange.com/q/1377221/103816 – user103816 Jul 28 '15 at 20:32
  • @mathlove So we have to use the same method But these involve quite tedious calculations because I chose a big denominator. – user103816 Jul 28 '15 at 20:41
  • @user103816: We usually use Fermat's little theorem and Euler's theorem (I have shown the method without using these theorems because it seems that you are not familiar with them). – mathlove Jul 28 '15 at 20:46
3

$a$ and $b$ leave the same remainders mod $m$ if and only if $m\mid a-b$.

In this case, use $a^n-b^n=(a-b)(a^{n-1}+a^{n-2}b+\cdots+b^{n-1})$ to see:

$$8^{30}-1^{30}=7\left(8^{29}+8^{28}\cdot 7+\cdots+7^{29}\right)$$

$7\mid 8^{30}-1^{30}$, therefore $8^{30}$ and $1^{30}$ leave the same remainders when divided by $7$.


So in general: $\,a\equiv b\,\pmod{\! m}\,\Rightarrow\, a^n\equiv b^n\,\pmod{\! m}$.

user26486
  • 11,519
1

Your request is quite odd seeing that the remainder of a number divided by some other number is called $a \mod b$. First,

$$1^{30}=1$$

Second the powers of 8 divided by 7 all have remainder one. 1 divided by seven has a remainder of 1. 8 has a remainder of 1. Division is commutative so if the remainder of 8 divided by 7 is one then the remainder of $64=8 \cdot 8$ is $1 \cdot 1$ etc. by induction any power of 8 divided by 7 has a remainder of 1.

Zach466920
  • 8,419
  • I didn't get how Division is commutative implies that any power of $8$ divided by $7$ gives the same reminder. – user103816 Jul 28 '15 at 19:09
  • What's the remainder of 64 divided by 7 is the same as the remainder of 8 divided by seven squared. $${{a \cdot b} \over c}={a \over c} \cdot {b \over c}$$ – Zach466920 Jul 28 '15 at 19:11
  • But how is this related to the commutative law of division? It might be merely a coincidence that 64/7 and 8/7 have the remainders. – user103816 Jul 28 '15 at 19:15
  • @user103816 this is about as clear as it gets. The remainder operation is commutative because division is commutative. – Zach466920 Jul 28 '15 at 19:17
  • Wait, ${{a \cdot b} \over c}\neq{a \over c} \cdot {b \over c}$. If a/b's reminder is $r$ then we must have a/b=q+r/b, from here how do I show that reminder of $a^2/b$ is also $r$? – user103816 Jul 28 '15 at 19:19
  • @user103816 we're talking about the remainder not the division, I should've used $\equiv$. That's why we use modular arithmetic. The remainder operator is distributive, I was using the wrong word, with respect to division. – Zach466920 Jul 28 '15 at 19:22
  • I've no problem with modular arithmetic if you give proper link to the proof of the formula you'd use. – user103816 Jul 28 '15 at 19:26
  • @user103816 it's almost an axiom it's so trivial. Say you have ${c \over d}$ the remainder is clearly equivalent to ${{a+b} \over d}$ if $c=a+b$ you can clearly take the remainders of 'a' and 'b' and then sum. This can obviously be extended to any number of addends. Addition and multiplication are interchangeable in many instances, example $2+2+2+2=4*2$ so there is your proof. – Zach466920 Jul 28 '15 at 19:36
  • Zach, I could not understand your last comment. As far as I understand it must not be an axiom. – user103816 Jul 28 '15 at 19:51
  • @user103816 I said it close to an axiom...I'm not going to hand -hold you, there is a giant internet with online resources on modular arithmetic, if you ever develop an interest for modular arithmetic I'd use them. This site falls in that list, I answer questions. I'm under no obligation to answer follow up questions. Although seriously you could've searched this site for your answer. Look here – Zach466920 Jul 28 '15 at 20:00
  • Let me help. If $a \equiv x \pmod{m}$ and $b \equiv y \pmod{m}$, then $a = x + pm$ and $b = y + qm$ for some integers $p, q$. Basically, $a$ and $x$ differ by some multiple of $m$ (which is why they have the same remainder). Similarly, $b$ and $y$ differ by a multiple of $m$. Now note that $a + b = x + y + m(p+q)$. Since $(p+q)$ is an integer, $a + b$ and $x+y$ differ by a multiple of $m$ and $a + b \equiv x + y \pmod{m}$ (that is, since they differ by a multiple of $m$, they have the same remainder when you divide by $m$.) – Tae Hyung Kim Jul 28 '15 at 20:01
  • @thkim1011 I've some questions for your comment. If I ask it as a new question "How to show reminder of $A^n/m$ is equal to reminder of $A/m$?" would you answer that? – user103816 Jul 28 '15 at 20:11
  • 1
    That's false though... however, if $a \equiv b \pmod{m}$, then it is true that $a^n \equiv b^n \pmod{m}$. – Tae Hyung Kim Jul 28 '15 at 20:14
  • @thkim1011 So it is just a coincidence that $8^n/7$ has same reminder always. Because $8^n=(7+1)^n$ hence $8^n (\mod 7) = 1^n (\mod 7)$. Its is no axiom. – user103816 Jul 28 '15 at 20:22
  • 1
    Yeah it is a coincidence in some way. Note that 9^n modulo 7 changes. However, because $8\equiv 1\pmod{7}$ and $ab \equiv xy \pmod{m}$ when $a \equiv x \pmod{m}$ and $b\equiv y \pmod m$, we can conclude that $8\cdot 8 \equiv 1\cdot 1 \pmod{7}$. Apply $ab\equiv xy\pmod{m}$ rule again to get $8\cdot8 \cdot 8\equiv 1 \cdot 1 \cdot 1 \pmod{m}$. This is primarily reason why you're allowed to exponentiate like that. – Tae Hyung Kim Jul 28 '15 at 20:26
1

Two numbers $x$ and $y$ have the same remainder on division by $7$ if and only if we can write $$x = 7a + b\\y=7a'+b$$ where $0\le b<7$ and $a, a'\in\mathbb Z$. Equivalently, we must have $7\mid (x-y)$.

(Rephrased in the notation of modular arithmetic, the above is saying that if $x\equiv b \pmod 7$ and $y \equiv b \pmod 7$, then $x-y\equiv 0 \pmod 7$).

Using the factorisation $$x^n-y^n \equiv (x-y)(x^{n-1}+x^{n-2}y+x^{n-3}y^2+\cdots+xy^{n-2}+y^{n-1})$$ can you show that $8^{30}-1^{30}$ is divisible by $7$?

Mathmo123
  • 23,718
  • I do not know how to show $8^{30}−1^{30}$ is divisible by $7$. – user103816 Jul 28 '15 at 19:13
  • Just edited to give you a strong hint on how to do it. – Mathmo123 Jul 28 '15 at 19:16
  • We are using the fact that 8-1=7. But does this method always for all these type of problems? E.g. say remainder of $123^{321}/87$. – user103816 Jul 28 '15 at 19:18
  • The fact that $8-1 = 7$ is crucial here... or more significantly, we need $8$ and $1$ to have the same remainder on division by $7$. In your other example, this method would work for any $a$ which has the same remainder as $123$ on division by $87$ – Mathmo123 Jul 28 '15 at 19:21
  • This all becomes much clearer when you put things into the language of modular arithmetic - $a \equiv b \pmod p \implies a^n \equiv b^n \pmod p$ – Mathmo123 Jul 28 '15 at 19:22
  • I am getting things now. I know little bit of modular notations. The problem is I don't know its formulas and if I directly ask the question then users will throw a bunch of formulas and solve quickly. – user103816 Jul 28 '15 at 19:24
  • But in my example a=36, i.e. 123 mod(87)= 36mod(87). How do I find the reminder of $36^n/87$? – user103816 Jul 28 '15 at 19:35
1

Another approach is, this: $ (a b)\;\mathrm{mod} \; p = \; ((a\; \mathrm{mod}\; p)(b\;\mathrm{mod}\;p) \;\mathrm{mod}\;p$. So in your example where $a = 8^{29}$ and $b = 8$. So you get $(8^{29} \;\mathrm{mod}\; 7)\;\mathrm{mod}\;7 = 8^{29} \;\mathrm{mod}\; 7$. This only works because $8 \;\mathrm{mod}\; 7 = 1$.

fho
  • 66
  • How can I prove $(a b);\mathrm{mod} ; p = ; ((a; \mathrm{mod}; p)(b;\mathrm{mod};p) ;\mathrm{mod};p$? – user103816 Jul 28 '15 at 19:42
  • If $a \equiv x \pmod p$ and $b \equiv y \pmod p$, then note that $a = x + pt$ and $b = y + ps$ for some integers $t,s$. Thus, $ab = xy + p(ty + sx + pst) \implies ab \equiv xy \pmod p$ – Tae Hyung Kim Jul 28 '15 at 19:43
  • @thkim1011 thanks for explaining. Could you tell me a book or website which explains formula's of modular arithmetic? – user103816 Jul 28 '15 at 19:48
  • 1
    I think the following might be useful: http://artofproblemsolving.com/wiki/index.php/Modular_arithmetic/Introduction . Btw, using $\mod$ as a function is pretty nonstandard (I think). – Tae Hyung Kim Jul 28 '15 at 19:52
  • But in your formula a is not x (mod p). And how is $(8^{29} ;\mathrm{mod}; 7);\mathrm{mod};7 = 8^{29} ;\mathrm{mod}; 7$? – user103816 Jul 28 '15 at 19:59
  • To clarify, you shouldn't use the notation $\pmod{m}$ to represent a function that takes the remainder when divided by $m$. Instead think of it as two numbers that share the same remainder. In other words, the two numbers should differ by a multiple of $m$. As an example, $10 \equiv 17 \pmod{7}$ since both numbers have the same remainder $3$. The statement you are confused about makes no sense if we go by standard notation. – Tae Hyung Kim Jul 28 '15 at 20:08
  • Is $(8^{29} ;\mathrm{mod}; 7);\mathrm{mod};7 = 8^{29} ;\mathrm{mod}\ 7$ because $8 \mod 7$ is less than 7? – user103816 Jul 29 '15 at 14:38