Find The Last Three Digits

A sequence of positive integers is defined as follows: a 1 = 2013 , a n + 1 = 3 a n 2 a n for n 1. a_1=2013, a_{n+1}=3^{a_n}-2^{a_n}\text{ for } n \geq 1. What are the last three digits of a 2014 ? a_{2014}?


The answer is 779.

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.

3 solutions

Since we are asked for the last 3 digits of a 2014 a_{2014} we can take the modulo 1 0 3 10^3

3 2013 2 2013 1 0 3 3 13 2 13 1 0 3 131 3^{2013}-2^{2013}\equiv_{10^3} 3^{13}-2^{13}\equiv_{10^3} 131

3 131 2 131 1 0 3 299 3^{131}-2^{131}\equiv_{10^3} 299

3 299 2 299 1 0 3 979 3^{299}-2^{299}\equiv_{10^3} 979

3 979 2 979 1 0 3 779 3^{979}-2^{979}\equiv_{10^3} 779

3 779 2 779 1 0 3 779 3^{779}-2^{779}\equiv_{10^3} 779

So we get that a i 1 0 3 779 i 5 a_i\equiv_{10^3}779 \ \forall \ i\geq 5

Hence a 2014 1 0 3 779 a_{2014} \equiv_{10^3} \boxed{779}

Disproved: 3 1001 2 1001 ̸ 1 0 3 3 1 2 1 3^{1001}-2^{1001}\not\equiv_{10^3}3^1-2^1

Kenny Lau - 7 years, 5 months ago

Log in to reply

Because the last 3 digits of \­( 2^{n} \­) are equal to the last 3 digits of \­( 2^{1000k+n} \­) if and only if n is greater than or equal to 3

Carl Araya - 7 years, 5 months ago

How did you get 3 13 2 13 1 0 3 131 3^{13}-2^{13} \equiv _{10^3} 131 ?

How did you get 3 131 2 131 1 0 3 299 3^{131}-2^{131} \equiv_{10^3} 299 , and similar computations?

minimario minimario - 7 years, 5 months ago

Log in to reply

3 13 2 13 3^{13}-2^{13} can be easily calculated as 1590227 1590227 3 131 2 131 1 0 3 3 31 2 31 = 617671248800299 3^{131}-2^{131} \equiv_{10^3} 3^{31}-2^{31}=617671248800299 for 299 you can take 99, witch CASIO handles pretty well.

Djordje Marjanovic - 7 years, 5 months ago

Log in to reply

is there another way to calculate the remainder when mod 1000 instead of using computer?

Fan Zhang - 7 years, 4 months ago

How do you know that 3 n 2 n 1 0 3 3 1000 k + n 2 1000 k + n \large3^n-2^n\equiv_{10^3}3^{1000k+n}-2^{1000k+n} ?

Kenny Lau - 7 years, 5 months ago

Log in to reply

Or vice versa?

Kenny Lau - 7 years, 5 months ago

Log in to reply

You have that 3 100 k + n 1 0 3 3 n 2 200 k + n 1 0 3 2 n 3^{100k+n}\equiv_{10^3}3^n \wedge 2^{200k+n}\equiv_{10^3}2^n \implies . 3 1000 k + n 1 0 3 3 n 2 1000 k + n 1 0 3 2 n 3^{1000k+n}\equiv_{10^3}3^n \wedge 2^{1000k+n}\equiv_{10^3}2^n \implies 3 1000 k + n 2 1000 k + n 1 0 3 3 n 2 n 3^{1000k+n}-2^{1000k+n}\equiv_{10^3}3^n-2^n

Djordje Marjanovic - 7 years, 5 months ago
Pebrudal Zanu
Jan 3, 2014

Lemma 3 1000 n + a 2 1000 n + a 3 a 2 a ( m o d 1000 ) 3^{1000n+a}-2^{1000n+a} \equiv 3^a-2^a \pmod{1000} , for n 1 n \geq 1 and a 3 a \geq 3

Prove Lemma From fermat litle theorem 3 1 000 1 m o d 1000 3^1000 \equiv 1 mod 1000 . It's mean 3 1000 n + a 3 a ( m o d 1000 ) 3^{1000n+a} \equiv 3^a \pmod{1000}

2 1 000 376 ( m o d 1000 ) 2^1000 \equiv 376 \pmod{1000} Suppose that a = 3 + x a=3+x

2 1000 n + 3 + x 376 × 2 3 + x 2 3 + x 2 a ( m o d 1000 ) 2^{1000n+3+x} \equiv 376 \times 2^{3+x} \equiv 2^{3+x} \equiv 2^a \pmod{1000}

From apply the lemma:

For next step I use wolframalfa.com for reach the result:

a 2 = 3 2013 2 2013 3 13 2 13 131 ( m o d 1000 ) a_2=3^{2013}-2^{2013} \equiv 3^{13}-2^{13} \equiv131 \pmod{1000}

a 3 3 131 2 131 299 ( m o d 1000 ) a_3 \equiv 3^{131}-2^{131} \equiv 299 \pmod{1000}

a 4 3 299 2 299 979 ( m o d 1000 ) a_4 \equiv 3^{299}-2^{299} \equiv 979 \pmod{1000}

a 5 3 979 2 979 779 ( m o d 1000 ) a_5\equiv 3^{979}-2^{979} \equiv 779 \pmod{1000}

a 6 3 779 2 799 779 ( m o d 1000 ) a_6 \equiv 3^{779}-2^{799} \equiv 779 \pmod{1000}

So, a 2014 a 14 779 ( m o d 1000 ) a_{2014} \equiv a_{14} \equiv \fbox{779} \pmod{1000}

a3 = 3^131 - 2^131 = 299 (mod 1000).... how did you solved this ?? please refrain from giving wolfram alpha as solution... can i solve this mentally??

Harsh Tripathi - 7 years, 5 months ago

Log in to reply

Use this fact:

3 100 n + a 3 a ( m o d 1000 ) 3^{100n+a} \equiv 3^a \pmod{1000} , proof by quadratic residue.

2 100 + a 2 a ( m o d 1000 ) 2^{100+a} \equiv 2^a \pmod{1000} , proof by you can use 2 10 24 ( m o d 1000 ) 2^{10} \equiv 24 \pmod{1000}

For n 1 n \geq 1 and a 3 a \geq 3

For a 2 , a 3 , a 4 , a 5 a_2, a_3, a_4,a_5 can use this such that you get smaller degree.

pebrudal zanu - 7 years, 5 months ago

3 1000 1 ( m o d 1000 ) 3^{1000} \equiv 1 \pmod{1000} , it's reason.... (actually, I use wolframalfa too, FLT not reasonable for my step :p )

From euler

3 400 1 ( m o d 1000 ) 3^{400} \equiv 1 \pmod{1000}

Aplly Quadratic residue we get

3 200 1 ( m o d 1000 ) 3^{200} \equiv 1 \pmod{1000}

So, 3 2 × 400 × 3 200 1 ( m o d 1000 ) 3^{2 \times 400} \times 3^{200} \equiv 1 \pmod{1000}

pebrudal zanu - 7 years, 5 months ago
Tan Kiat
Jan 7, 2014

To approach this problem, we must first be able to find the last 3 digits for 3 n 3^n and 2 n 2^n .

Consider this method for finding the last 3 digit for 3 n 3^n , for this case , 3 2013 3^{2013} , 3 2013 3^{2013} = 3 ( 10 1 ) 1006 3(10-1)^{1006} . Hence, expanding the binomial expansion, we have :

3 ( 10 1 ) 1006 3(10-1)^{1006} = 3 [ ( 1 ) 1006 + ( 1006 ) ( 1 ) 1005 ( 10 ) + ( 1006 ) ( 1005 ) 2 ( 1 ) 1004 ( 10 ) 2 ] = 3[(-1)^{1006} + (1006)(-1)^{1005}(10) + \frac{(1006)(1005)}{2}(-1)^{1004}(10)^2] (mod 1000 1000 )

= 3 [ 1 60 + 500 ] = 3 [ 1 - 60 + 500 ] (mod 1000 1000 )

= 1323 = 323 = 1323 = 323 (mod 1000 1000 )

For powers of 2, in this case, if you were to write out 100 powers of 2, you would notice that for 2 n 2^n , the cycle repeats in the period of 100 100 , excluding 2 1 2^1 and 2 2 2^2 .

Hence, 2 2013 = 2 13 = 192 2^{2013} = 2^{13} = 192 (mod 1000 1000 )

Thus, we now find the value of a 2 a_2 , which is equals to 323 192 = 131 323 - 192 = 131

Repeat the process for finding last 3 digits of 3 n 3^n using the binomial expansion and finding last 3 digits of 2 n 2^n by taking a mod 100 100 on the power, writing a table of first 100 powers of 2 n 2^n and refer to. It would be too tedious to type out all 100 powers.

Hence, 3 131 = 947 3^{131} = 947 (mod 1000 1000 ) , 2 131 = 2 31 = 648 2^{131} = 2^{31} = 648 (mod 1000 1000 ) . Thus , a 3 = 299 a_3 = 299 (mod 1000 1000 ).

Thus, 3 299 = 667 3^{299} = 667 (mod 1000 1000 ) , 2 299 = 2 99 = 688 2^{299} = 2^{99} = 688 (mod 1000 1000 ) . Hence , a 4 = 979 a_4 = 979 (mod 1000 1000 ).

3 979 = 867 3^{979} = 867 (mod 1000 1000 ) , 2 979 = 2 79 = 779 2^{979} = 2^{79} = 779 (mod 1000 1000 ) . Hence , a 5 = 779 a_5 = 779 (mod 1000 1000 )

3 779 = 867 3^{779} = 867 (mod 1000 1000 ) , 2 779 = 2 79 = 779 2^{779} = 2^{79} = 779 (mod 1000 1000 ) . Hence , a 6 = 779 a_6 = 779 (mod 1000 1000 )

From this value of a 6 a_6 , where the powers of 2 and 3 regenerates back the value of its power. Hence, we can deduce that

a n + 1 = a n a_{n+1} = a{n}

Thus, a 2013 = a 6 = 779 a_{2013} = a{6} = \boxed{779}

I did not plan to write a solution until I saw my solution is quite different from the solutions posted so far. I am not picking this one to comment. I just need some place to write my solution.

First, notice that a n a_n is odd for n 1 n\ge1 . If m = 2 k + 1 3 m=2k+1\ge3 , then 3 m 2 m 3 9 k 3 m o d 8 3^m-2^m\equiv 3\cdot9^k \equiv 3 \bmod 8 . Hence a n 3 m o d 8 a_n\equiv 3 \bmod 8 for n 2 n\ge2 and also a n 3 m o d 4 a_n\equiv 3 \bmod 4 for n 2 n\ge2 .

Next, if m = 4 k + 3 m=4k+3 , then 3 m 2 m = 3 3 81 k 2 3 16 k 4 m o d 5 3^m-2^m = 3^3\cdot{81}^k - 2^3\cdot{16}^k\equiv 4 \bmod 5 . Hence a n 4 m o d 5 a_n\equiv 4 \bmod 5 for n 3 n\ge3 .

By Chinese Remainder Theorem, we have a n 1 m o d 20 a_n\equiv -1 \bmod 20 for n 3 n\ge3 .

Futuermore, if m = 20 k 1 m=20k-1 , then by Euler's Theorem 3 m 2 m = 3 1 3 20 k 2 1 2 20 k 17 13 = 4 m o d 25 3^m-2^m = 3^{-1}\cdot3^{20k} - 2^{-1}\cdot2^{20k}\equiv 17-13=4 \bmod 25 . Hence a n 4 m o d 25 a_n\equiv 4 \bmod 25 for n 4 n\ge4 .

By Chinese Remainder Theorem again, we have a n 79 m o d 100 a_n\equiv 79 \bmod 100 for n 4 n\ge4 .

Finally, if m = 100 k + 79 m=100k+79 , then by Euler's Theorem again 3 m 2 m 3 79 2 79 = 3 ( 10 1 ) 39 2 ( 5 1 ) 39 29 m o d 125 3^m-2^m \equiv 3^{79} - 2^{79} = 3(10-1)^{39} -2(5-1)^{39}\equiv 29 \bmod 125 by binomial expansion. Hence a n 29 m o d 125 a_n\equiv 29 \bmod 125 for n 5 n\ge5 .

Apply Chinese Remainder Theorem one more time, we have a n 779 m o d 1000 a_n\equiv 779 \bmod 1000 for n 5 n\ge5 .

George G - 7 years, 5 months ago

Log in to reply

I think this ones the best way...I also did it by repeated application of the chinese remainder theorem.....

Eddie The Head - 7 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...