use CountedIterable to optimize some _n algorithms