  Given a finitely generated free monoid $X$ and a morphism $\phi : X\to X$, we
show that one can construct an algebra, which we call an iterative algebra, in
a natural way. We show that many ring theoretic properties of iterative
algebras can be easily characterized in terms of linear algebra and
combinatorial data from the morphism and that, moreover, it is decidable
whether or not an iterative algebra has these properties. Finally, we use our
construction to answer several questions of Greenfeld, Leroy, Smoktunowicz, and
Ziembowski by constructing a primitive graded nilpotent algebra with
Gelfand-Kirillov dimension two that is finitely generated as a Lie algebra.
