# The Naked Scientists Forum

### Author Topic: Arithmatic  (Read 4414 times)

#### syhprum

• Neilep Level Member
• Posts: 3823
• Thanked: 19 times
##### Arithmatic
« on: 21/05/2008 19:04:16 »
Not exactly a physics problem but would be physicists must understand maths!
A problem set by a popular magazine with a trivial money prize.

Work out the the last three integers of 3^123456, I make it 883 by a rather clumsy process, does anyone know an elegant way to do it and am I correct.
The prize I believe is about €25 I do not intend to enter.
« Last Edit: 21/05/2008 22:43:43 by syhprum »

#### turnipsock

• Hero Member
• Posts: 586
• Beekeeper to the unsuspecting
##### Arithmatic
« Reply #1 on: 21/05/2008 23:05:20 »
what is ^

#### syhprum

• Neilep Level Member
• Posts: 3823
• Thanked: 19 times
##### Arithmatic
« Reply #2 on: 22/05/2008 06:01:53 »
Raised to the power of! i.e   2^10 = 1024, 3^2 = 9, 3^123456 = a hell of a lot (don't try this on your pocket calculator).
« Last Edit: 22/05/2008 15:01:44 by syhprum »

#### LeeE

• Neilep Level Member
• Posts: 3382
##### Arithmatic
« Reply #3 on: 22/05/2008 17:27:18 »
Bit short of time atm, but there appears to be a repeating pattern for the last and second last digits - the pattern for the last digit cycles over four values and the pattern for the second last appears to cycle over twenty values.

#### JP

• Neilep Level Member
• Posts: 3366
• Thanked: 2 times
##### Arithmatic
« Reply #4 on: 22/05/2008 17:48:29 »
521

This is according to Mathematica.   I can get the last digit from the cycle from 1->3->9->7->1... of multiplying by 3 each time, but I haven't figured out a pattern to get the 5 and 2 yet.

...

My previous answer was wrong, although it got the right answer.  Here's the "fixed" result.  I think this one should be good...

This relies on finding 3^12 first.

3^12 = 531441, which isn't too tough to do on a calculator, or even by hand if you're feeling like some long multiplication.

The next step is to decompose 123456 in terms of 12*(2^a+2^b+...).  If you do this, you get:

123456=12*(2^13+2^11+2^5+2^4)

Next, you use the property that 3^(a+b+c+d)=3^a*3^b*3^c*3^d:

3^123456=3^[12*(2^13+2^11+2^5+2^4)]=3^(12*2^13)*3^(12*2^11)*3^(12*2^5)*3^(12*2^4).

3^(12*2^n)=3^(12*2*2*2*2*2...*2), which means to take 3^12 and square it n times. You can do this squaring by the earlier method of only retaining the last 3 digits:
3^12=...441
3^(12*2)=(...441)*(...441)=...481
3^(12*2^2)=(...481)*(...481)=...361
3^(12*2^3)=...321
3^(12*2^4)=...041
3^(12*2^5)=...681
3^(12*2^6)=...761
3^(12*2^7)=...121
3^(12*2^8)=...641
3^(12*2^9)=...881
3^(12*2^10)=...161
3^(12*2^11)=...921
3^(12*2^12)=...241
3^(12*2^13)=...081

So back to
3^123456=3^(12*2^13)*3^(12*2^11)*3^(12*2^5)*3^(12*2^4)
3^123456=(...041)*(...681)*(...921)*(...081)=...521
« Last Edit: 22/05/2008 22:47:09 by jpetruccelli »

#### syhprum

• Neilep Level Member
• Posts: 3823
• Thanked: 19 times
##### Arithmatic
« Reply #5 on: 22/05/2008 19:46:21 »
I worked on much the same principal but ran into difficulties after getting to 3^122880 = *****081, this was still 576 short and I did not know the best way to deal with this.
I scoured the internet for a trial version of 'Mathematica' but was unable to find one !.

#### syhprum

• Neilep Level Member
• Posts: 3823
• Thanked: 19 times
##### Arithmatic
« Reply #6 on: 22/05/2008 20:17:43 »
I hate to disagree with one who has much more mathematics than my sub 'O' education but there are errors in your table

Step 1:  Start from 3^6 = 729
Step 2:  Take (3^6)^6=3^12= ...121

(3^6)^6 = 3^36  not 3^12 !

#### DoctorBeaver

• Naked Science Forum GOD!
• Posts: 12656
• Thanked: 3 times
• A stitch in time would have confused Einstein.
##### Arithmatic
« Reply #7 on: 22/05/2008 20:44:16 »
I hate to disagree with one who has much more mathematics than my sub 'O' education but there are errors in your table

Step 1:  Start from 3^6 = 729
Step 2:  Take (3^6)^6=3^12= ...121

(3^6)^6 = 3^36  not 3^12 !

I think you're right.

#### JP

• Neilep Level Member
• Posts: 3366
• Thanked: 2 times
##### Arithmatic
« Reply #8 on: 22/05/2008 21:49:21 »
I hate to disagree with one who has much more mathematics than my sub 'O' education but there are errors in your table

Step 1:  Start from 3^6 = 729
Step 2:  Take (3^6)^6=3^12= ...121

(3^6)^6 = 3^36  not 3^12 !

I think you're right.

Oops!  I added instead of multiplying. :p  Somehow I still got the answer mathematica agreed with... let me fix this up.

#### JP

• Neilep Level Member
• Posts: 3366
• Thanked: 2 times
##### Arithmatic
« Reply #9 on: 22/05/2008 22:43:51 »
That was quite a bit tougher without my "magic math" (otherwise known as a mistake) to make it work in a few easy steps.  I edited it to post my revised solution.  I think it's right, but I haven't double checked it.
http://www.thenakedscientists.com/forum/index.php?topic=14683.msg175092#msg175092

#### syhprum

• Neilep Level Member
• Posts: 3823
• Thanked: 19 times
##### Arithmatic
« Reply #10 on: 23/05/2008 09:57:27 »
Many thanks jpetruccelli for the excellent tutorial if I ever have to solve such a problem again will be confident how to do it.

I referred to the problem as one of arithmetic, where does the border line between arithmetic and maths lie?, I think of special relativity as arithmetic and general as maths !.

The 'New Scientist' publishes similar problems each week under the title of 'Enigma' most of which can be solved by a simple brute force program that runs thru all the possibilities but this one seemed to require more specialised knowledge.
« Last Edit: 23/05/2008 10:02:52 by syhprum »

#### JP

• Neilep Level Member
• Posts: 3366
• Thanked: 2 times
##### Arithmatic
« Reply #11 on: 23/05/2008 18:39:27 »
I referred to the problem as one of arithmetic, where does the border line between arithmetic and maths lie?, I think of special relativity as arithmetic and general as maths !.

I bet different people will give you different answers.  For me, arithmetic is when you have a formula (involving multiplication, division, addition, subtraction, roots and powers) and just plug numbers into it to get an answer.  Mathematics is everything else involving numbers.  The solution I gave up above is probably more mathematics, since it involved more steps than just plugging numbers in and calculating.

#### The Naked Scientists Forum

##### Arithmatic
« Reply #11 on: 23/05/2008 18:39:27 »

Login
Login with username, password and session length