I figured it out, can't figure out how to delete it, sorry to make a post about nothing.

Printable View

- 01-26-2011, 08:43 PMsunde887Digit sum of extremely large numbers
I figured it out, can't figure out how to delete it, sorry to make a post about nothing.

- 01-26-2011, 09:07 PMpbrockway2
Roughly speaking n(n+1) will have twice as many digits as n and the resulting exponential growth of the digit length of n! is going to be a problem sooner or later.

Perhaps some number theory is called for.

Some people make a distinction between digit sums and*reduced*digit sums (ie 456->15 vs 456->6): which do you mean?

[Edit] The question was to find the digit sum of 50000! - 01-26-2011, 10:00 PMsunde887
I ended up figuring it out by using big int to string method differently, then I just looped through the produced string, changing each item to an int with parseInt, and finally adding it to sum.