Let m be a positive integer larger than 1, let w be a finite word over {0,1,...,m−1} and let am;w(n) be the number of occurrences of the word w in the m-expansion of n mod p for any non-negative integer n. In this article, we first give a fast algorithm to generate all sequences of the form (am;w(n))n∈N; then, under the hypothesis that m is a prime, we prove that all these sequences are m-uniformly but not purely morphic, except for w=1,2,...,m−1; finally, under the same assumption of m as before, we prove that the power series ∑i=0∞am;w(n)tn is algebraic of degree m over Fm(t).