11Department of Mathematics, Faculty of Civil Engineering, University of Zagreb,
2Department of Mathematics, Qaemshahr Branch, Islamic Azad University, Qaemshar, Iran
3Department of Mathematics, Babol Branch, Islamic Azad University, Babol, Iran
We show how generalized Zagreb indices $M_1^k(G)$ can be computed by using a simple graph polynomial and Stirling numbers of the second kind. In that way we explain and clarify the meaning of a triangle of numbers used to establish the same result in an earlier reference.