Author Topic: Last Two Digits Problem  (Read 4130 times)

0 Members and 1 Guest are viewing this topic.

Offline Ender

  • Moderator
  • Hero Member
  • *****
  • Posts: 2390
    • View Profile
Last Two Digits Problem
« on: June 21, 2007, 12:47:31 am »
Find the last two digits of



Note: The solution is on my blog, so no posting if you look at my blog :P
« Last Edit: June 21, 2007, 09:39:43 am by Ender »

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Last Two Digits Problem
« Reply #1 on: June 21, 2007, 09:32:22 am »
Let me start the ball rolling by saying that the first four digits are 4393.

We're half way there!

Offline Ender

  • Moderator
  • Hero Member
  • *****
  • Posts: 2390
    • View Profile
Re: Last Two Digits Problem
« Reply #2 on: June 21, 2007, 09:41:33 am »
hehe

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Last Two Digits Problem
« Reply #3 on: June 21, 2007, 10:08:36 am »
Is the answer 5689?

Ender: Sorry, I modified this post instead of replying lol.
« Last Edit: June 21, 2007, 10:27:00 am by Ender »

Offline Ender

  • Moderator
  • Hero Member
  • *****
  • Posts: 2390
    • View Profile
Re: Last Two Digits Problem
« Reply #4 on: June 21, 2007, 10:26:24 am »
Last two digits. But yeah, 89 is correct :P

Did you do that programmatically? If so... how the hell?

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Last Two Digits Problem
« Reply #5 on: June 21, 2007, 10:30:26 am »
Yes, I did. And sorry for not being able to count. :)

Footnote: Java owns

<edit>
Quote
ron@facevision:~$ cat Test.java
import java.math.BigInteger;

public class Test
{
        public static void main(String []args)
        {
                System.out.println(new BigInteger("9").pow(9).pow(9).pow(9));
        }
}

ron@facevision:~$ javac Test.java
ron@facevision:~$ java Test
439328503696464329829774782657072712058010308177126710621676697750466344744764029773301412612482563729435064854354299095570379503452515853238520182740967398746503532324400000659505126023955913142968176998364877699089666171297275956245407453033190168644894850576346492691458695174281789557994923607783461486426448617667076393901104477324982631297641034277093818692823488603426279473674368943609268871793467206677285688478458498235002859256706389043030847945506577080623430066283504397583789044245429585982964571774605868466160379567432725704121260940939343217905975847365096315872153240969882363435363449775254393010368267343970426230801390250903399147001650831878665172798468587509747439118815689
« Last Edit: June 21, 2007, 10:32:12 am by iago »

Offline Ender

  • Moderator
  • Hero Member
  • *****
  • Posts: 2390
    • View Profile
Re: Last Two Digits Problem
« Reply #6 on: June 21, 2007, 10:57:35 am »
lol!

JAVA FIGHTING@@!!!~~~

Note: the mathematical solution is still up-for-grabs :P

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Last Two Digits Problem
« Reply #7 on: June 21, 2007, 11:04:58 am »
Don't worry, my friend's working on that. And he's elite. I'll report back later. :)

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Last Two Digits Problem
« Reply #8 on: June 21, 2007, 11:13:22 am »
Well, my friend here figured it out mathematically and showed me, and totally lost me in number theory. It involved mod100 at the start, which made sense. Then he talked about phi and prime factors and recursion and I got confused. So yeah, it's up for grabs. :)

Offline Ender

  • Moderator
  • Hero Member
  • *****
  • Posts: 2390
    • View Profile
Re: Last Two Digits Problem
« Reply #9 on: June 21, 2007, 11:16:04 am »
Hehe. Modular arithmetic is one way to do it. There's also an algebraic way that doesn't require knowledge of number theory. Look on my blog.

Offline Ender

  • Moderator
  • Hero Member
  • *****
  • Posts: 2390
    • View Profile
Re: Last Two Digits Problem
« Reply #10 on: June 21, 2007, 08:23:14 pm »
Yes, I did. And sorry for not being able to count. :)

Footnote: Java owns

<edit>
Quote
ron@facevision:~$ cat Test.java
import java.math.BigInteger;

public class Test
{
        public static void main(String []args)
        {
                System.out.println(new BigInteger("9").pow(9).pow(9).pow(9));
        }
}

ron@facevision:~$ javac Test.java
ron@facevision:~$ java Test
439328503696464329829774782657072712058010308177126710621676697750466344744764029773301412612482563729435064854354299095570379503452515853238520182740967398746503532324400000659505126023955913142968176998364877699089666171297275956245407453033190168644894850576346492691458695174281789557994923607783461486426448617667076393901104477324982631297641034277093818692823488603426279473674368943609268871793467206677285688478458498235002859256706389043030847945506577080623430066283504397583789044245429585982964571774605868466160379567432725704121260940939343217905975847365096315872153240969882363435363449775254393010368267343970426230801390250903399147001650831878665172798468587509747439118815689


The 89 is right, but that's gotta be wrong, because the number is x-drillions of digits long. Just consider 10^10^10, which is obviously less than 9^9^9^9. 10^10 is ten billion. Raise ten to that power and you will have ten billion and one digits.
« Last Edit: June 21, 2007, 08:37:10 pm by Ender »

Offline Ender

  • Moderator
  • Hero Member
  • *****
  • Posts: 2390
    • View Profile
Re: Last Two Digits Problem
« Reply #11 on: June 21, 2007, 08:36:39 pm »
Okay, as to why your answer matched with mine...If you look at my blog answer, it really doesn't matter what n is.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Last Two Digits Problem
« Reply #12 on: June 21, 2007, 08:46:17 pm »
Pfft, you and all the other math geeks in the world do exponents wrong. Left to right! Comp sci for life! :P

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Last Two Digits Problem
« Reply #13 on: June 21, 2007, 10:04:11 pm »
Well the last digit is easy.  9^n always has a last digit of 1 or 9, so there's that.  I'm not quite sure about the second, but I'll get around to it.