JOURNAL OF MATHEMATICAL CHEMISTRY, cilt.57, sa.2, ss.609-615, 2019 (SCI-Expanded)
The inverse problem for integer-valued topological indices is about the existence of a graph having its index value equal to a given integer. We solve this problem for the first and second Zagreb indices, and present analogous results also for the forgotten and hyper-Zagreb index. The first Zagreb index of connected graphs can take any even positive integer value, except 4 and 8. The same is true if one restricts to trees or to molecular graphs. The second Zagreb index of connected graphs can take any positive integer value, except 2, 3, 5, 6, 7, 10, 11, 13, 15 and 17. The same is true if one restricts to trees or to molecular graphs.