Combinatorics and Number Theory of Counting Sequences