http://www.perlmonks.org?node_id=1016001


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 :)
  • Comment on Re^2: Finding sum of all digits from 1 to 1 million.