In commutative algebra the Hilbert–Samuel function, named after David Hilbert and Pierre Samuel, of a nonzero finitely generated module M{\displaystyle M} over a commutative Noetherian local ring A{\displaystyle A} and a primary ideal I{\displaystyle I} of A{\displaystyle A} is the map χMI:N→N{\displaystyle \chi _{M}^{I}:\mathbb {N} \rightarrow \mathbb {N} } such that, for all n∈N{\displaystyle n\in \mathbb {N} },