The existence of extrasolar planets with short orbital periods suggests that planetary migration induced by tidal interaction with the protoplanetary disk is important. Cores and terrestrial planets may undergo migration as they form. In this paper we investigate the evolution of a population of cores with initial masses in the range 0.1-1 M⊕ embedded in a disk. Mutual interactions lead to orbit crossing and mergers, so that the cores grow during their evolution. Interaction with the disk leads to orbital migration, which results in the cores capturing each other in mean motion resonances. As the cores migrate inside the disk inner edge, scatterings and mergers of planets on unstable orbits, together with orbital circularization, causes strict commensurability to be lost. Near commensurability however is usually maintained. All the simulations end with a population typically between two and five planets, with masses depending on the initial mass. These results indicate that if hot super-Earths or Neptunes form by mergers of inwardly migrating cores, then such planets are most likely not isolated. We would expect to always find at least one, more likely a few, companions on close and often near-commensurable orbits. To test this hypothesis, it would be of interest to look for planets of a few to about 10 M⊕ in systems where hot super-Earths or Neptunes have already been found.