in reply to Re: Finding sum of all digits from 1 to 1 million.
in thread 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 :)
In Section
Seekers of Perl Wisdom