Last two digits

Find the last two digits of 7 100 3 100 . 7^{100}-3^{100}.


The answer is 0.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

8 solutions

7 4 = 2401 1 m o d 100 7^{4} = 2401 \equiv 1 \mod{100} , so 7 100 = ( 7 4 ) 25 1 m o d 100 7^{100} = (7^{4})^{25} \equiv 1 \mod{100} .

To find 3 100 m o d 100 3^{100} \mod{100} we can use Euler's Theorem . Since ϕ ( 100 ) = 40 \phi(100) = 40 we know that 3 40 1 m o d 100 3^{40} \equiv 1 \mod{100} and thus 3 100 3 20 m o d 100 3^{100} \equiv 3^{20} \mod{100} .

Now 3 5 = 243 43 m o d 100 3^{5} = 243 \equiv 43 \mod{100} , so 3 20 4 3 4 1 m o d 100 3^{20} \equiv 43^{4} \equiv 1 \mod{100} , and so 7 100 3 100 0 m o d 100 7^{100} - 3^{100} \equiv 0 \mod{100} , i.e., the last two digits are 00 \boxed{00} .

(Another approach to this last part is to note that ( 3 20 ) 2 = 3 40 1 m o d 100 (3^{20})^{2} = 3^{40} \equiv 1 \mod{100} , so 3 20 3^{20} is a solution to the equation x 2 1 m o d 100 x^{2} \equiv 1 \mod{100} , the smallest solution of which is 1 m o d 100 1 \mod{100} . However, there are other solutions for x x , namely 49 , 51 49, 51 and 99 99 .)

Use Carmichael's function . λ ( 100 ) = lcm ( λ ( 25 ) , λ ( 4 ) ) = lcm ( 20 , 2 ) = 20 \lambda (100)=\text{lcm}(\lambda(25),\lambda(4))=\text{lcm}(20,2)=20 . Thus 7 100 3 100 7 0 3 0 = 1 1 = 0 ( m o d 100 ) 7^{100}-3^{100}\equiv 7^{0}-3^{0}=1-1=0\pmod{100} .

Another way: 7 100 3 100 = 4 ( 7 99 + 7 98 3 1 + + 3 99 ) 7^{100}-3^{100}=4(7^{99}+7^{98}3^{1}+\cdots+3^{99}) . What is left to prove is that 7 100 3 100 0 ( m o d 25 ) 7^{100}-3^{100}\equiv 0\pmod {25} , but this is simple since ϕ ( 25 ) = 20 \phi(25)=20 .

mathh mathh - 6 years, 6 months ago

Log in to reply

Cool. I hadn't heard of Carmichael's function before. Good to know. :)

Brian Charlesworth - 6 years, 6 months ago

How is this good for two digits. Should it not be only the last digit is 0?

Amit Mittal - 5 years, 2 months ago

Log in to reply

Since 7 100 3 100 0 ( m o d 100 ) 7^{100} - 3^{100} \equiv 0 \pmod{100} we know that 7 100 3 100 7^{100} - 3^{100} is divisible by 100 100 , and thus its last two digits must be 00 00 .

Brian Charlesworth - 5 years, 2 months ago

How do you know that Euler's Function of 100 is 40? Also, how to find Euler's Function value of big numbers like, say, 1000? Please help.

Akshat Jain - 5 years, 6 months ago

Log in to reply

We can use the fact that Euler's totient function is multiplicative, i.e., if m , n m,n are coprime, then ϕ ( m n ) = ϕ ( m ) ϕ ( n ) . \phi(mn) = \phi(m) * \phi(n).

So as 100 = 4 25 100 = 4*25 and g c d ( 4 , 25 ) = 1 gcd(4,25) = 1 we know that ϕ ( 100 ) = ϕ ( 4 ) ϕ ( 25 ) . \phi(100) = \phi(4)*\phi(25).

Next, we can use the fact that for p p prime, ϕ ( p k ) = p k p k 1 . \phi(p^{k}) = p^{k} - p^{k-1}. Then

ϕ ( 4 ) = ϕ ( 2 2 ) = 2 2 2 1 = 2 \phi(4) = \phi(2^{2}) = 2^{2} - 2^{1} = 2 and ϕ ( 25 ) = ϕ ( 5 2 ) = 5 2 5 1 = 20. \phi(25) = \phi(5^{2}) = 5^{2} - 5^{1} = 20.

We can thus conclude that ϕ ( 100 ) = 2 20 = 40. \phi(100) = 2*20 = 40.

With 1000 = 2 3 5 3 1000 = 2^{3}*5^{3} we would have

ϕ ( 1000 ) = ϕ ( 2 3 ) ϕ ( 5 3 ) = ( 2 3 2 2 ) ( 5 3 5 2 ) = 4 100 = 400. \phi(1000) = \phi(2^{3})*\phi(5^{3}) = (2^{3} - 2^{2})(5^{3} - 5^{2}) = 4*100 = 400.

So one method to determine ϕ ( n ) \phi(n) is to first decompose n n into its prime factors and then use the two formulas mentioned above to make the final calculation. This method can be summarized by Euler's product formula, (proof provided in the aforementioned link),

ϕ ( n ) = n p n ( 1 1 p ) . \phi(n) = n\displaystyle\prod_{p|n} \left(1 - \dfrac{1}{p}\right).

As an example, with n = 1000 n = 1000 this formula gives us that

ϕ ( 1000 ) = 1000 ( 1 1 2 ) ( 1 1 5 ) = 1000 1 2 4 5 = 400 , \phi(1000) = 1000*\left(1 - \dfrac{1}{2}\right)\left(1 - \dfrac{1}{5}\right) = 1000*\dfrac{1}{2}*\dfrac{4}{5} = 400,

in agreement with our previous result.

Brian Charlesworth - 5 years, 6 months ago

Log in to reply

Thank you very much, sir.

Akshat Jain - 5 years, 6 months ago

Log in to reply

@Akshat Jain You're welcome. :)

Brian Charlesworth - 5 years, 6 months ago

I used practically the same approach. For those that don't know Euler's theorem, they could of kept on calculating powers of to get 3^10 is equivalent to 7^2 mod(100), which would of lead to 3^100 is equivalent to 1 mod (100).

Curtis Clement - 6 years, 6 months ago

Till now I still don't really understand euler's theorem so I solved this question by recognising the patterns of 3 n {3}^{n} and 7 n {7}^{n} . Thats another way...

Julian Poon - 6 years, 6 months ago

Please explain the step: 4 3 5 1 ( m o d 100 ) 43^5\equiv 1 \pmod{100}

Akshat Jain - 5 years, 6 months ago

Log in to reply

Oh, sorry, that was a typo; it should be 4 3 4 1 ( m o d 100 ) . 43^{4} \equiv 1 \pmod{100}. As this is a small power we could just multiply it out by hand. Noting that 4 3 2 = 1849 , 43^{2} = 1849, we would have that

4 3 4 4 9 2 ( m o d 100 ) 1 ( m o d 100 ) 43^{4} \equiv 49^{2} \pmod{100} \equiv 1 \pmod{100} since 4 9 2 = 2401. 49^{2} = 2401.

For this last step we could also have noted that

4 9 2 = ( 50 1 ) 2 = 5 0 2 2 50 + 1 1 ( m o d 100 ) . 49^{2} = (50 - 1)^{2} = 50^{2} - 2*50 + 1 \equiv 1 \pmod{100}.

Or we could have directly used the binomial expansion for 4 3 4 43^{4} as follows:

4 3 4 = ( 50 7 ) 4 = 5 0 4 4 5 0 3 7 + 6 5 0 2 7 2 4 50 7 3 + 7 4 7 4 ( m o d 100 ) 1 ( m o d 100 ) . 43^{4} = (50 - 7)^{4} = 50^{4} - 4*50^{3}*7 + 6*50^{2}*7^{2} - 4*50*7^{3} + 7^{4} \equiv 7^{4} \pmod{100} \equiv 1 \pmod{100}.

So there are a number of ways to make this calculation. :)

Brian Charlesworth - 5 years, 6 months ago

@Brian Charlesworth Another way would be a N 0 ( m o d N ) a^N \equiv 0 (mod N)

A Former Brilliant Member - 5 years, 6 months ago

Wait, why is it that you used 3^5 for 3, but 7^4 for 7?

Rahul Chandra - 5 years, 6 months ago

Log in to reply

We are free to choose powers that we think will make the calculation easiest, so there is no requirement to choose the same power in each case. Having said that, and now that you mention it, I could have gone with a binomial expansion in the following way:

3 20 = ( 3 4 ) 5 = 8 1 5 = ( 80 + 1 ) 5 = 8 0 5 + 5 8 0 4 + 10 8 0 3 + 10 8 0 2 + 5 80 + 1 1 ( m o d 100 ) , 3^{20} = (3^{4})^{5} = 81^{5} = (80 + 1)^{5} = 80^{5} + 5*80^{4} + 10*80^{3} + 10*80^{2} + 5*80 + 1 \equiv 1 \pmod{100},

since all the terms in the expansion except for 1 1 are divisible by 100. 100.

Brian Charlesworth - 5 years, 6 months ago

How is this good for two digits. Should it not be only the last digit is 0?

Amit Mittal - 5 years, 2 months ago
Advay Pal
Nov 29, 2014

One can also use the binomial theorem. (10-3)^100 - 3^100 = 100n + 3^100 - 3^100 =100n (where n is an integer)

Diya Rao
Nov 29, 2014

The last digit is asked so v shall go by finding out the last digit 7 powers goes by the last digits 7,9,3,1, 7,9,3,1 ..... And 3powers goes as 3,9,7,1 3,9,7,1... So 100/4 is divisible so it is of order 4 so 1-1 = zero

(7^4)25-(3^4)25=(1)^25-(1)^25=0 according to Euler's Theorem.

Peter Macgregor
Nov 20, 2014

Reply to Mathh Mathh

I loved your Carmichael function solution.

Note, though that

λ [ 4 ] = 2 \lambda[4]=2

John Wroblewski
Dec 19, 2016

We have that 7 10 49 m o d 100 7^{10} \equiv 49 \mod 100 , and also 3 10 49 m o d 100 3^{10} \equiv 49 \mod 100 . Then we need the solution to 4 9 10 4 9 10 m o d 100 49^{10} - 49^{10} \mod 100 , which is then equivalent to 0 m o d 100 0 \mod 100 , which yields the answer of 0.

William Li
Nov 29, 2014

I used an inefficient way. I just constructed a table and found a pattern.

Now C'mon Calvin Lin. Just by looking at the 6 it's obvious that the 6 multiplied by 2 ends in 2. Was this a joke ?

DarkMind S. - 4 years, 9 months ago

Since we have to find the last digit of the crazy number (is that so?), let us work mod 10 :

We have,

7 100 3 100 = ( 3 ) 100 3 100 = 3 100 3 100 = 0 \displaystyle 7^{100} - 3^{100} = (-3)^{100} - 3^{100} = 3^{100} - 3^{100} = 0 mod 10

And hence the answer!

You were lucky. The question asked last two digits, so we need to work modulo 100 instead.

Satvik Golechha - 6 years, 6 months ago

Log in to reply

hey Satvik how did you get it?I just made a pattern but I just got another method!

Adarsh Kumar - 6 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...