Sum of n consecutive numbers is n*(n+1)/2. So one way to compute this is add the first 79 and subtract the first 23. So, it is (79*80/2) - (23*24/2). read more