Let set A contain the integers 1-48 inclusive.
The sum of all the integers is 48-1+1=48 and so we use n(n+1)/2 to get 1176.
How do we sum just the odd numbers OR just the even numbers?
Think like Gauss. Gauss invented the formula for summing the first n integers by pairing up numbers. So, you paired up 1 with 48, 2 with 47, 3 with 46, and so on. Those sums are all the same: 1 + 48 = 49, 2 + 47 = 49, etc. How many of those pairs are there? n/2. Hence, (n/2)(n+1) is the sum. I bet you could reproduce this thinking for just the evens or just the odds. What do you think?
Try this on for size: for the evens from 1 to 48, inclusive:
2 + 48 = 50
4 + 46 = 50
How many of these pairs are there? Well, there are 24 even numbers from 1 to 48, inclusive, so I'd say there are 12 pairs.
That is, the sum is equal to ... what do you think?
If you're not finding my hints helpful, please just say so, and I can try a different track. You're not following my reasoning at all. This forum's purpose is not to just give you the answer, but to help you own the answer for yourself. That won't happen unless you do most of the work. We'll help you get unstuck, but that's as far as we go.
Without disrepsect to the many clever solutions so far:
1,3,5,7,9,....,47 is a linear progression and there are standard methods for summing those. It can easily be transformed into a hypergeometric progression (with ratio 1) and there are also standard methods for summing those.
You have a formula for the sum of all integers in the range, and undefined gave you a clever formula for the sum of all even numbers in the range. The sum of all odd numbers is the difference between the two
1+2+3+4+5+....+47+48 = 1176 (in question)
2+4+6+8+...48 = 600 (from undefined's clever post)
1+3+5+7+9+...47 = 1176-600
What about this trick...I think it works for almost everything:
Use formula a+(n-1)+d=x
where a= first number in progression, d=difference in progression and x=last number in progression. Solve for n.
Then, take n(a+x)/2=Sum of numbers.
So, if we want to sum the odd numbers, we see that we havev 1+3+5+...+47
a=1 and d=2 and x=47.
I think you can use this to find all even, odd, numbers divisible by 7 etc etc