Think about Loose Coupling | |
PerlMonks |
Re^2: Finding sum of all digits from 1 to 1 million.by Anonymous Monk |
on Jan 30, 2013 at 08:59 UTC ( [id://1016001]=note: print w/replies, xml ) | Need Help?? |
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
|
|