Is there a way to use a facet so that it creates a histogram on every X occurrences in a sequence?

As an example, if net was a sequence of numbers ordered by date like:

1,2,3,4,5,6,7
and I set the interval to 2, I would like to get back a histogram like:

count: 2
value: 3,

count: 2,
value: 7,

count: 2,
value: 11,