Efficient computations with counting functions on free groups and free monoids. - Tobias Hartnick; Alexey L. Talambutsa (CoRR, 2021)