4
$\begingroup$

This is in relation to the Euler Problem $13$ from http://www.ProjectEuler.net.

Work out the first ten digits of the sum of the following one-hundred $50$-digit numbers.

$37107287533902102798797998220837590246510135740250$

Now, this was my thinking:

I can freely discard the last fourty digits and leave the last ten.

$0135740250$

And then simply sum those. This would be large enough to be stored in a $64$-bit data-type and a lot easier to compute. However, my answer isn't being accepted, so I'm forced to question my logic.

However, I don't see a problem. The last fourty digits will never make a difference because they are at least a magnitude of $10$ larger than the preceding values and therefore never carry backwards into smaller areas. Is this not correct?

  • 0
    @Calc1DropOut: That edit was *completely* unnecessary. It did not provide an actual improvement in readability and just bumped a three years old post to the top of the front page. Please avoid these in the future, front page time is an extremely expensive resource.2013-03-07

2 Answers 2

8

If you were supposed to find the last ten digits, you could just ignore the first 40 digits of each number. However you're supposed to find the first ten digits, so that doesn't work. And you can't just ignore the last digits of each number either because those can carry over.

4

First you are doing it in the wrong end, second, the statement in general is still not correct.

for example:

9999999999 1000000001 

Say if you want the first 2 digits, you will get 10 if you discard the last 2 digit and do the sum. The right answer is 11