Wiener index and Harary index are two classic and well-known topological indices for the characterization of molecular graphs. Recently, Yu et al. [14] established some sufficient conditions for a graph to be pancyclic in terms of the edge number, the spectral radius and the signless Laplacian spectral radius of the graph. In this paper, we give some sufficient conditions for a graph being pancyclic in terms of the Wiener index, the Harary index, the distance spectral radius and the Harary spectral radius of a graph.