Modular arithmetic + some other stuff on numbers

In summary: 7^3=343=1 mod 13hence 7^51 mod 13=1 mod 13=1so 7^51=13k+1 for soem integer k.this is still faster then the first, if you have to do powers of 2 mod 13 just use the power of 2 rule and when you get to a power of 1 just stop, and use fermat's little theorem. 7^4=9 mod 13, 7^3=21=8 mod 13, 7^2=10 mod 13, 7^1=7 mod 13.also there is a pattern to these powers (on way to look
  • #1
Benny
584
0
Hi, I've just begun studying modular arithmetic and as yet, I haven't got a reference text to work from so I'm hoping that someone can help me out with the following questions.

Q. Calculate 7^2(mod 13), 7^4(mod 13), 7^8(mod 13) and 7^9(mod 13).

I can't think of a way to do this without actually working out 7^n and repeatedly subtracting multiples of 13. Is there a pattern to this? The answers are:

[tex]
7^2 \equiv 10\left( {\bmod 13} \right),7^4 = 9\left( {\bmod 13} \right),7^8 \equiv 3\left( {\bmod 13} \right),7^9 \equiv 8\left( {\bmod 13} \right)
[/tex].

So for the first one with 7^2 identically equal to 10(mod13) that just means that the difference between 7^2 and 10 is exactly divisible by 13 right? It turns out that 7^2 - 10 = 39 which is exactly divisible by 13. The 'remainder' is 10. I'm wondering if there is a standard procedure to evaluate the expressions in the question or if brute force is required.

I just have some other really basic questions which I would like some help with. I have no confidence when dealing with anything even vaguely related to number theory so I'd really like some help with these.

Q. Suppose a divides b. Show that a^m divides b^m for all integers m > 0.

So by definition of b I have b = ca for some integer c. b^m = (ca)^m = (c^m)(a^m). I have that c is an integer so that c^m is also an integer since m is a positive integer. If I set d = c^m then I get b^m = da^m so that a^m divides b^m. I just seem to be stating the obvious so I'm not sure about this one.

Q. Suppose that a divides al the integers x_1, x_2,...,x_n. Show that a divides the linear combination: [tex]\lambda _1 x_1 + ... + \lambda _n x_n [/tex] where each of the lamdas are integers.

Ok so a divides each of the x_i, i = 1,2...,n. So [tex]c_1 a + c_2 a + ... + c_n a = x_1 + x_2 + ... + x_n [/tex]

[tex]
\Rightarrow \left( {\lambda _1 c_1 + \lambda _1 c_2 + ...\lambda _n c_n } \right)a = \lambda _1 x_1 + \lambda _2 x_2 + ...\lambda _n x_n
[/tex]

[tex]
\lambda _1 x_1 + \lambda _2 x_2 + ... + \lambda _n x_n
[/tex]

[tex]
b = \left( {\lambda _1 c_1 + \lambda _2 c_2 + ...\lambda _n + c_n } \right) \in Z \Rightarrow b \in Z
[/tex]

The result follows from that? Any help would be appreciated.
 
Last edited:
Physics news on Phys.org
  • #2
Hi, I've just begun studying modular arithmetic and as yet, I haven't got a reference text to work from so I'm hoping that someone can help me out with the following questions.

Q. Calculate 7^2(mod 13), 7^4(mod 13), 7^8(mod 13) and 7^9(mod 13).

I can't think of a way to do this without actually working out 7^n and repeatedly subtracting multiples of 13. Is there a pattern to this? I'm wondering if there is a standard procedure to evaluate the expressions in the question or if brute force is required.

I don't know about standard procedure or tricks as i have not had reason to do complicated modular arithmatic, but it helps to do reductions in intermediate steps. Also powers can be done in terms of powers of two and powers become cyclic
7^0=1
7^1=7
7^2=49=10
7^3=70=5
7^4=35=9
7^5=63=11
7^6=77=12
7^7=84=6
7^8=42=3
7^9=8
7^10=4
7^11=2
7^12=1
7^13=7
7^14=10
and so on
7^n=7^mod(n,12)
power of 2 powers are also nice
7^(2^0)=7^1=7
7^(2^1)=7^2=10
7^(2^2)=10^2=9
7^(2^3)=9^2=3
7^(2^4)=3^3=9
7^(2^5)=9^2=3
and so on with alternating 9 and 3
this makes your problem easy
7^2,7^4,7^8 appear naturally
7^9=(7^1)(7^8)=7*3=8


I just have some other really basic questions which I would like some help with. I have no confidence when dealing with anything even vaguely related to number theory so I'd really like some help with these.

Q. Suppose a divides b. Show that a^m divides b^m for all integers m > 0.

So by definition of b I have b = ca for some integer c. b^m = (ca)^m = (c^m)(a^m). I have that c is an integer so that c^m is also an integer since m is a positive integer. If I set d = c^m then I get b^m = da^m so that a^m divides b^m. I just seem to be stating the obvious so I'm not sure about this one.
Yes it is that obvious
Q. Suppose that a divides al the integers x_1, x_2,...,x_n. Show that a divides the linear combination: [tex]\lambda _1 x_1 + ... + \lambda _n x_n [/tex] where each of the lamdas are integers.

Ok so a divides each of the x_i, i = 1,2...,n. So [tex]c_1 a + c_2 a + ... + c_n a = x_1 + x_2 + ... + x_n [/tex]

[tex]
\Rightarrow \left( {\lambda _1 c_1 + \lambda _1 c_2 + ...\lambda _n c_n } \right)a = \lambda _1 x_1 + \lambda _2 x_2 + ...\lambda _n x_n
[/tex]

[tex]
\lambda _1 x_1 + \lambda _2 x_2 + ... + \lambda _n x_n
[/tex]

[tex]
b = \left( {\lambda _1 c_1 + \lambda _2 c_2 + ...\lambda _n + c_n } \right) \in Z \Rightarrow b \in Z
[/tex]

The result follows from that? Any help would be appreciated.[/QUOTE]
For this one it I would show
a|b & a|c -> a|(b+c)
and
a|b -> a|(kb)
then use induction to get the general result
That makes it more clear for me personally
Your approch is right though
 
Last edited:
  • #3
Thanks for your help lurflurf.

After going through my first post again I see that I made a mistake when I typed out my answer. The bit with b = (...) should have the product lamba sub n and x sub n instead of the sum of those two terms.
 
Last edited:
  • #4
wheneever you are doing modular arithmetic you can reduce mod whateever *at any time*. the standard short cut is to raise things to powers of 2 since that is just squaring.

example 7^51 mod 13.

7^2=49=10 mod 13

so this is 7.10^25 mod (13)

and you could repeat this, idea.

the next best is to work out 7^2, then (7^2)^2 =7^4 and ((7^2)^2)^2=7^8
(((7^2)^2)^2)^2)=7^16 and that with 5 raises of the power 2. do this by square and reduce square and reduce each time.

then 51 = 32+16+4+1 so 7^51=7^(32)7^(16)7^(4)7

a better way yet is to nkow fermat's little theorem: if a and p are comprime and p is a rime then a^{p-1}=1 mod p

so 7^12=1 mod 13 hence 7^51 = 7^{48}7^3=7^3 mod 13
 

1. What is modular arithmetic?

Modular arithmetic is a type of arithmetic that deals with integers and their remainders when divided by a fixed integer, known as the modulus. It is often used in number theory and cryptography.

2. How is modular arithmetic different from regular arithmetic?

In regular arithmetic, the focus is on the exact value of a number. However, in modular arithmetic, the focus is on the remainder when dividing by a fixed integer. This allows for a different set of operations and properties.

3. What is the significance of the modulus in modular arithmetic?

The modulus is a fixed integer that determines the "size" of the numbers in modular arithmetic. It is the number that is used to divide and get the remainder, and it also determines the range of numbers that can be represented in modular arithmetic.

4. How is modular arithmetic used in cryptography?

Modular arithmetic is used in cryptography to encrypt and decrypt messages. It allows for the creation of secret codes and keys, as well as providing a way to securely transmit information over public channels.

5. Can modular arithmetic be applied to any type of number?

Modular arithmetic can be applied to any type of integer, including positive and negative numbers. However, it does not work for fractions or decimals, as these cannot be divided by a fixed integer to get a remainder.

Similar threads

  • Introductory Physics Homework Help
Replies
7
Views
969
Replies
4
Views
218
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
13
Views
491
  • Atomic and Condensed Matter
Replies
4
Views
1K
  • Electromagnetism
Replies
2
Views
846
  • Advanced Physics Homework Help
2
Replies
36
Views
2K
  • Introductory Physics Homework Help
Replies
1
Views
709
  • Calculus and Beyond Homework Help
Replies
16
Views
1K
  • Introductory Physics Homework Help
Replies
10
Views
1K
Back
Top