I think you may be right. I don't think the answer you have is correct. There is actualy a formula to calculate the sum of the numbers from 1-n. It is (n^2)/2 + n/2 which in the case of n=1000000 the answer is 500000500000
---If it doesn't fit use a bigger hammer
Comment on Re: Finding sum of all digits from 1 to 1 million.
The formula you need is:-
1/2n (n+1)
N is the number.
Eg (all numbers from one to ten), ten is number.
So 1/2 * 10 =5 * (10+1) =55
Comes from sigma notation.....and i never got any gcses :)