# Help with Program

• 06-05-2013, 11:57 AM
CodeX Pro
Help with Program
Quote:

A googol (10^100) is a massive number: one followed by one-hundred zeros; 100^100 is almost unimaginably large: one followed by two-hundred zeros. Despite their size, the sum of the digits in each number is only 1.

Considering natural numbers of the form, a^b, where a, b < 100, what is the maximum digital sum?
Can anyone help me with the above program implemented in Java. I am not understanding a bit. Please help me with the code.

Thank you,
Sincerely,
Psycho_Coder
• 06-05-2013, 12:13 PM
JosAH
Re: Help with Program
I don't understand your notation, e.g. what does 'a, b 100' mean?

kind regards,

Jos
• 06-05-2013, 12:16 PM
SurfMan
Re: Help with Program
We would love to help you with the code, but there is none. What do you have so far? Which part do you have problems with? If you have nothing yet, I suggest you slide away your keyboard and start with pen and paper. Write down what you think are the steps needed to solve your problem.
• 06-05-2013, 12:25 PM
CodeX Pro
Re: Help with Program
Quote:

Originally Posted by JosAH
I don't understand your notation, e.g. what does 'a, b 100' mean?

kind regards,

Jos

• 06-05-2013, 01:21 PM
JosAH
Re: Help with Program
Quote:

Originally Posted by CodeX Pro

Let ds(x) be the digital sum of x; ds(a^b) == ds(ds(a)^b); the maxmum value for ds(x) is 9 and ds(9^n) == 9, so for any value of a where ds(a) == 9 and ds(a^b) also equals 9.

kind regards,

Jos
• 06-05-2013, 01:45 PM
SurfMan
Re: Help with Program
Quote:

Originally Posted by JosAH
Let ds(x) be the digital sum of x; ds(a^b) == ds(ds(a)^b); the maxmum value for ds(x) is 9 and ds(9^n) == 9, so for any value of a where ds(a) == 9 and ds(a^b) also equals 9.

kind regards,

Jos

Just... wow... :)
• 06-05-2013, 09:06 PM
JosAH
Re: Help with Program
Quote:

Originally Posted by SurfMan
Just... wow... :)

There's nothing wow about it; it's just bean counter logic and it saves you from writing tedious program code ;-)

kind regarrds,

Jos
• 06-06-2013, 12:15 AM
jim829
Re: Help with Program
Quote:

Considering natural numbers of the form, a^b, where a, b < 100, what is the maximum digital sum?
First some clarity. A digit sum is a one time sum of the digits of a number. So the digital sum of 12345 = 15. The repeated digital sum or digital root of the same is 6 because the procedure is recursive.

Perhaps I missed something here but it seems to me the maximum of a digital root is 9 is obvious. You can always recursively sum up the resulting digits until you are left with a single digit. And since 3^2 fits the description you got 9.

Regards,
Jim