A number theory problem

What is the remainder when 2 123456789 2^{123456789} is divided by 7?


The answer is 1.

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.

17 solutions

Jake Lai
May 17, 2015

We know 123456789 123456789 is a multiple of 3 3 since the sum of its digits is 45 45 , which is a multiple of 3 3 itself. Hence, 2 123456789 2^{123456789} can be written as

2 123456789 = ( 2 3 ) n = 8 n 2^{123456789} = (2^{3})^{n} = 8^{n}

where n n is some positive integer. Taking 8 n 8^{n} mod 7 7 , we get

2 123456789 8 n ( 7 + 1 ) n 1 n 1 ( m o d 7 ) 2^{123456789} \equiv 8^{n} \equiv (7+1)^{n} \equiv 1^{n} \equiv \boxed{1} \pmod{7}

Moderator note:

Great work of identifying it's a multiple of 3 and noticing 2 3 1 m o d 7 2^3 \equiv 1 \bmod 7 .

Same method

shivamani patil - 6 years ago

Noticed the same pattern by applying Fermat's Little Theorem. Nice obvservation there.

Devin Ky - 6 years ago

awesome. even I didn't thought that way

Raghav Gupta - 5 years, 11 months ago

Did exactly the same. I just learned modular arithmetic or I should I am still learning it..upvoted! 😀😀

Anurag Pandey - 4 years, 10 months ago

N i c e p r o c e s s s Nice processs :)

Prokash Shakkhar - 4 years, 6 months ago

I did the same.

AAJEEIO ACADEMY - 3 years, 6 months ago

Same approach.can be solved binomially even without modular arithmetic knowledge.

aman mishra - 3 years ago

that was easy

Harrison Wells - 2 years, 2 months ago

(7 + 1) ^ n == 1 ^ n (mod 7), why?

Yujin Kim - 12 months ago

Log in to reply

Binomial expansion. If you start expanding your LHS, every term except the last term will have 7 raised to some power (so all those are divisible by 7 or modulo is 0 so we don't care about them). But last term will be 7^0 x 1^n =1^n

Baheej Anwar - 10 months ago

I do not know if this would work but I saw as you did that the sum of digits is 45. Using that I broke it up into (2^9)^x is congruent to 1 mod 7 (since 2^9=(2^3)^3 and 8 mod 7 is just 1). So you are left with 1^x is congruent to 1 mod 7. The smallest positive integer value for x is 1. So the answer is just 1.

Mr. Krabs - 5 months, 1 week ago

Exactly what I did, though not so elaborately.

Utkarsh Chaturvedi - 5 years, 6 months ago

Notice what I did. 123456789 / 7 = 17636684. Something.

Ignore the something and multiply 7 x 17636684 = 123456788 Now, 123456789 - 123456788 = 1

I was able to bypass the base and any modular congruence. Please post this solution as a breakthrough.

DarkMind S. - 4 years, 9 months ago

Log in to reply

I think ,you are wrong, bcoz as per your process, you only consider and operate on the power and the base doesn't matter which means if the base is some other integer ( say, 3) your answer would be same (i.e. 1), but sadly that is not the correct answer. In case of base = 3, the correct ans is 6.

Suman Roy - 4 years, 3 months ago
Wei Xin Ong
May 30, 2015

Through trial and error, we can simply find that 2 3 1 ( m o d 7 ) 2^3 \equiv 1 (mod 7) 2 123456789 = ( 2 3 ) 4115263 2^{123456789} = (2^{3})^{4115263} ( 2 3 ) 4115263 1 4115263 ( m o d 7 ) (2^{3})^{4115263} \equiv 1^{4115263} (mod 7) So, 2 123456789 1 ( m o d 7 ) 2^{123456789} \equiv 1 (mod 7)

Amogh Huddar
Feb 9, 2018

2 123456789 2^{123456789} = 2 3 41152263 2^{3*41152263} = ( 2 3 2^3 ) 41152263 ^{41152263} [ By laws of exponents- a b c a^{bc} = ( a b ) (a^b) c ^c ]

= 8 41152263 8^{41152263}

Let as assume that 41152263= γ \gamma

Now, 8 1 ( m o d 7 ) 8 \equiv 1 \pmod{7}

=> 8 γ 1 γ ( m o d 7 ) 8^\gamma \equiv 1^\gamma \pmod{7} [ By laws of exponentiation in modular arithmetic- if a b ( m o d p ) a \equiv b \pmod{p} , then a k b k ( m o d p ) a^k \equiv b^k \pmod{p} ]

Now 1 raised to any power remains 1.

=> 8 γ 1 ( m o d 7 ) 8^\gamma \equiv 1 \pmod{7}

From the above statement we can finally conclude that when 2 123456789 2^{123456789} is divided by 7, it leaves a remainder of 1.

@Amogh Huddar learning latex

Shreyansh Mukhopadhyay - 3 years, 4 months ago

@Ayon Ghosh I think that this solution is going to be our new chatbox as it is empty and by @Amogh Huddar

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

Gonna stay up late at night studying Bio I guess...so might be online around 11:45-12 :30 today night...Anybody up for it ??

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

Ya man I will study construction

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay Oh crap I am gonna cram in Math within that 1 hour break between Nso and Imo tommorrow.

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh You can obviously do that. You are topper buddy.

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay No bruh I am intending to only do the summaries at the back LOL.

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh Hey can you give me hint to integrate 1/1+x ^n

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay Latex it friend.

And dont please ask Nonsense stuff now as am really FRENZIED abt tommorrow didnt study a thing !!

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh Study what will be useful in near future...( near future means exactly 13 hours left for NSO OMG !!! )

Ayon Ghosh - 3 years, 4 months ago

@Ayon Ghosh Ok so bye. Chemistry ChemistryChemistryChemistryChemistryChemistry yay. FireFire

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay Ya was gonna say the same..BYE.

Ayon Ghosh - 3 years, 4 months ago

Damn the Nitrogen Cycle...Cant make heads nor tails of it (soooo many types of bacteria ).

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh May be but I will study chemistry

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay Yay officially completed 3 chapters of Bio MTG 3 more to go !!!

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh I am really facing difficulty with trigonometry in integrals!! Trying to understand it

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay True I wasted my morning studying Congruences when I cud have done Bio !! Trigonometric integrals basically are done either by u substi or optimization ( sometimes rarely by parts )

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh I actually don't mood to do bio

Shreyansh Mukhopadhyay - 3 years, 4 months ago

bruh padhai ho gayi ?? 1 more hr to go !!! Aur mai abhi bhi Bio kr rha hu !!

Ayon Ghosh - 3 years, 4 months ago

@Shreyansh Mukhopadhyay @Amogh Huddar Any one wants to chat I am kinda free as of now (cuz I dont go to play now ).

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

I am going to play so sorry.

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Was there electricity at your home about half an hour ago.

Shreyansh Mukhopadhyay - 3 years, 4 months ago

@Shreyansh Mukhopadhyay @Amogh Huddar bhaiyo thoda bata do kaunsa Math Prac karna hai sirf ek ya saare tino.

Aur sun Amogh , kal tu mere liye Cutouts leke aayega for that Circles acitivity samjha be ??

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh prac 1, 22, 17

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

All three ???

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh any two, your choice.

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay Ohhhhhhhhhhhhhhhhh mannnnnnn then I 'd better get to work quick.

Never mind I will write and at same time also chat !!

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh i'll do it tomorow morning. 4:00AM

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay Hmmm...at that time I am deep into my dreams.

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh @Ayon Ghosh – And did you open the link that i sended you at the evening.?

Shreyansh Mukhopadhyay - 3 years, 4 months ago

@Ayon Ghosh And did you open the link that i sended you at the evening.?

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay Hey I got an update Kishlay got a Math achiever wrong !! That Circle one Q.47 he did angle AEC whereas answer was 2 angle AEC ( according to me that is).

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh don't talk about that, I ain't no mood.

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay Why ( son of a son of a ? )

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh Because I left all quest. from 23-35

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay Im talking abt IMO.

Ayon Ghosh - 3 years, 4 months ago

Log in to reply

@Ayon Ghosh I'm also talking about that only.

Shreyansh Mukhopadhyay - 3 years, 4 months ago

Log in to reply

@Shreyansh Mukhopadhyay Get Lost and get your dinner.

Dont talk nonsense with me.

Ayon Ghosh - 3 years, 4 months ago

@Ayon Ghosh Ok bye going to get my dinner.

Shreyansh Mukhopadhyay - 3 years, 4 months ago

@Amogh Huddar amogh mere liye bhi please .

Shreyansh Mukhopadhyay - 3 years, 4 months ago

@Ayon Ghosh , @Amogh Huddar are you there.

Shreyansh Mukhopadhyay - 3 years, 4 months ago

@Ayon Ghosh , @Amogh Huddar don't forget tomorrow is computer practical exam

Shreyansh Mukhopadhyay - 3 years, 4 months ago
DarkMind S.
Aug 20, 2016

Notice what I did. 123456789 / 7 = 17636684. Something.

Ignore the something and multiply 7 x 17636684 = 123456788 Now, 123456789 - 123456788 = 1

I was able to bypass the base and any modular congruence. Please post this solution as a breakthrough.

I think ,you are wrong, bcoz as per your process, you only consider and operate on the power and the base doesn't matter which means if the base is some other integer ( say, 3) your answer would be same (i.e. 1), but sadly that is not the correct answer. In case of base = 3, the correct ans is 6.

Suman Roy - 4 years, 3 months ago

Log in to reply

I also believe that this approach arrived at the right answer through the wrong reasoning.

Barry Becker - 3 years, 5 months ago

After several trial-and-error approaches I found that 2^9 ≡ 1 (mod 7). I also noticed that 123456789 is divisible by 9, so

(2^9)^(something) ≡ (1)^(something) ≡ 1 (mod 7).

[After reading other answers I realize that I missed the 2^3 ≡ 1 (mod 7) approach what had been more simple].

Sayan Sengupta
Oct 10, 2019

We can use Fermat's Little theorem to see that 2^6 is congruent to 1 (mod 7). The power = 123456789 leaves remainder 3 when divided by 6. Thus we have 2^(6*k)[FOR SOME INTEGER k) is congruent to 1 (mod 7) and 2^3 is congruent to 1 (mod 7). Thus we have 2^(123456789) is congruent to (1 x 1)=1 (mod 7).

Hemang Gautam
Aug 17, 2019

2 is congruent to 2(mod7) 2^3 is congruent to 1(mod 7) Therefore remainder is 1

Philippa Gadsby
Jul 29, 2018

This method is longer than those I've seen; it focusses on patterns more.

From 2^x (where x<123456790), you can see that the remainders when dividing by 7 form a pattern:

For x = 1,2,3,4 ,

2^1= 2 where 2 mod 7 = 2,

2^2 = 4 where 4 mod 7 = 4,

2^3 = 8 where 8 mod 7 = 1,

2^4 = 16 where 16 mod 7 = 2.

This cycle, consisting of the three key components (the 2, 4 and 1) repeats until 2^123456789 is reached.

123456789 mod 3 is what we are interested in, since there are 3 different components in the pattern. By doing this, you are seeing if there is a remainder from the number of groups there are of these 3 components before the number 123456789. This remainder will guide us into finding the right remainder for the initial problem.

123456789 mod 3 = 0 therefore there are complete number of groups of the components 2, 4 and 1 before reaching 123456789.

Therefore the remainder of 2^123456789 is 1 (the final component in the group.)

Your explanation is the only one I've read that shares the "pattern focus" of mine, although yours seems more rigorous and sure-footed than mine. Truth be told, I'm not sure if what I did is correct (might've gotten lucky), let alone related to your explanation. If it is related, I'm still not sure to what extent. All that being said, what I did was this:

2^123456789mod7= [(2^(1x10^8))(2^(2x10^7))(2^(3x10^6))(2^(4x10^5))(2^(5x10^4))(2^(6x10^3))(2^(7x10^2))(2^(8x10^1))(2^9)]mod7

I dropped the 10^n's in each term. I think this is okay, since 2 goes into each of these evenly, and dividing 2^(given coefficient) by 7 would yield the same remainder as the one including the given 10^n. There's probably a more concise way to explain that, haha. Anyway, thus,

[(2^1)(2^2)(2^3)(2^4)(2^5)(2^6)(2^7)(2^8)(2^9)]mod7=

[(2)(4)(8)(16)(32)(64)(128)(256)(512)]mod7=

[(2)(4)(1)(2)(4)(1)(2)(4)(1)]mod7= 8^3mod7= 512mod7= 1. This last line shows the cycle that appeared in your explanation. I don't think the appearance of the cycle is by chance, my solution might be.

Maximilian Eddington - 8 months, 4 weeks ago
Olaleye Hammed
Apr 10, 2017

Taking the last digit into consideration 9, we can have (2^9)=(2^3)^3 and 2^3=1(mod 7). So we can now have , 1^3=1.

Why did you take the last digit? I think that you got the right answer just by chance because if you take the last two digits, 89, the modulo is 2^89 = 4 (mod 7).

If I guess right, you were lucky that the whole number 123456789 is divisible by 9, and 2^9=1 (mod 7), so (2^9)^13717421 ≡ (1)^13717421 ≡ 1 (mod 7).

Finding that 2^9 ≡ 1 (mod 7) and that 123456789 is divisible by 9 is how I solved it.

Félix Pérez Haoñie - 1 year, 2 months ago
SwayamS Mohapatra
Jan 20, 2017

Sum of 1+2+...+9 = n(n+1)/2 = 9×10/2 = 45 So as 45%3=0 (2)^3 has same remainder with that of (2)^123456789 2^3 % 7 = 1

2 123456789 2 123456789 m o d ϕ ( 7 ) 2 123456789 m o d 6 2 3 8 1 2^{123456789} \equiv 2^{123456789 \bmod \phi (7) } \equiv 2^{123456789 \bmod 6} \equiv 2^3 \equiv 8 \equiv 1 ( m o d \bmod 7 7 )

Sayonto Khan
Apr 18, 2016

We can solve it by Fermat's Little theorem :: - "if P is a prime number and a is an integer where a is not divisible by P, then a^(p-1) is equivalent to 1 (Mod P)

Vikram Nadig
Jun 2, 2015

We can find the remainders when various powers of 2 are divided by 7. Then, we can prove that they form a cycle.

Raymond Fernandez
May 20, 2015

I figured that any power of 2 divided by an odd integer would have 1 as the remainder.

Moderator note:

A simple 2 3 2^{3} divided by 3 3 shows that you're wrong.

Aayush Agarwal
May 20, 2015

2^123456789=8^41152263 =(7+1)^41152263 therefore, rem=1

Moderator note:

Although you're right, you don't need to manually calculate 123456789 ÷ 3 = 41152263 123456789 \div 3 = 41152263 . You just need to show that 3 3 divides 123456789 123456789 . In this case, divisibility rule of 3 3 is the simplest.

Refer to Jake Lai's solution.

Amartya Kalapahar
May 20, 2015

It is of the form 8k +1. So just divide it by 7 to get the answer

Moderator note:

Your solution is extremely not clear. What is of the form 8 k + 1 8k+1 ? Even if you clarified which expression you're referring to (which is also wrong), how did you made that claim? Even after all that, how did you get 1 as the answer?

Read Jake Lai's solution for a proper approach.

Naveen M R
May 19, 2015

2^133556789 --cosider 2^(last no. 9)÷7. Gives reminder as 1

Moderator note:

Wrong. A simple counterexample would be 2 19 2^{19} , you would get the answer of 1 1 as well but in fact it should be 2 2 . Your logic is flawed. You copied the number wrongly and you should not only consider the last number.

A basic way to solve this is to apply Fermat's Little Theorem or by simply noticing the pattern for the remainder of 2 1 , 2 2 , 2 3 , 2^1, 2^2, 2^3, \ldots . Can you notice a pattern?

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...