Moderately-hard functions are useful for many applications and there are quite many papers concerning on moderately-hard functions. However, the formal model for moderately-hard functions have not been proposed. In this paper, first, we propose the formal model for moderately-hard functions. For this purpose, we construct the computational model and investigate the properties required for moderately-hard functions. Then, we propose that some particular functions can be used as moderately-hard functions. These functions are based on two ideas: the difficulty of factoring $p^r q$ and sequential computation of primitive functions.