Prime visits -prime sieve problem(video)

in the last step why are we doing csum[b]-csum[a-1]?

why not csum[b]-csum[a]?

hello @ajay1970
u have reopend this doubt.
do u still have any doubt in this problem

yes i have a doubt…its not cleared yet

we dont want to exclude a from our answer thats why

csum[b] wil have sum from 0 till b.

csum[a-1] will have sum from 0 till a-1.
so if we subtract we get sum between a to b.