i believe your talking something akin to the following picture. i was thinking a similar idea but i initially though about changing the sample rate rather than the number of samples but it still accomplishes the same thing.
oh and my example may not be perfectly optimized fyi.
or depending on the data being processed and how it needs to be used you could just divide, round, multiply, which will give you an approximated value but wont account well for large spikes in the value.

