Hierarchies of number-theoretic functions. I