Sum of primes between given range
J,41 32 19 characters:
Update
(simple sieve)
g=:+/@(*1&p:)@-.&i.
e.g.
100 g 1
1060
250000x g 48
2623030823
Previous
h=:3 :'+/p:i.(_1 p:>:y)'
f=:-&h<:
eg:
100 f 1
1060
Mathematica 7 (31 chars in plain text)
If PARI/GP solution allowed, then:
Plus@@Select[Range[a,b],PrimeQ]
C, 117 bytes
main(a,b,s,j){
s=0,scanf("%d%d",&a,&b);
for(a+=a==1;a<=b;a++)
for(s+=a,j=2;j<a;)
s-=a%j++?0:(j=a);
printf("%d",s);
}