Jiyoung Kim

Greenhorn

Posts: 15

posted 10 months ago

I've tried to add the numbers from the starting point to the end point what I want.

The end point is the pow of 10, so the number will be so huge if I enter the big number.

So, I guessed that I need to use BigInteger to handle it. However, I'm wondering that there is a way to reduce the time to calculate the summation.

Even I entered 9 or 10, the calculation is slow. I researched some documents of BigInteger, but I didn't have an idea how to modify.

Please let me know some better ways to calculate the sum a little bit faster.

The end point is the pow of 10, so the number will be so huge if I enter the big number.

So, I guessed that I need to use BigInteger to handle it. However, I'm wondering that there is a way to reduce the time to calculate the summation.

Even I entered 9 or 10, the calculation is slow. I researched some documents of BigInteger, but I didn't have an idea how to modify.

Please let me know some better ways to calculate the sum a little bit faster.

posted 10 months ago

Using mathematics .... ... the sum of an arithmetic series is equals to the sum of the first term plus the last term, multiplied with the number of terms, divided by two.

So ...

Henry

Jiyoung Kim wrote:

Please let me know some better ways to calculate the sum a little bit faster.

Using mathematics .... ... the sum of an arithmetic series is equals to the sum of the first term plus the last term, multiplied with the number of terms, divided by two.

So ...

Henry

Campbell Ritchie

Marshal

Posts: 56541

172