  Some recently discovered short-period Earth to Neptune sized exoplanets
(super Earths) have low observed mean densities which can only be explained by
voluminous gaseous atmospheres. Here, we study the conditions allowing the
accretion and retention of such atmospheres. We self-consistently couple the
nebular gas accretion onto rocky cores and the subsequent evolution of gas
envelopes following the dispersal of the protoplanetary disk. Specifically, we
address mass-loss due to both photo-evaporation and cooling of the planet. We
find that planets shed their outer layers (dozens of percents in mass)
following the disk's dispersal (even without photo-evaporation), and their
atmospheres shrink in a few Myr to a thickness comparable to the radius of the
underlying rocky core. At this stage, atmospheres containing less particles
than the core (equivalently, lighter than a few % of the planet's mass) can be
blown away by heat coming from the cooling core, while heavier atmospheres cool
and contract on a timescale of Gyr at most. By relating the mass-loss timescale
to the accretion time, we analytically identify a Goldilocks region in the
mass-temperature plane in which low-density super Earths can be found: planets
have to be massive and cold enough to accrete and retain their atmospheres,
while not too massive or cold, such that they do not enter runaway accretion
and become gas giants (Jupiters). We compare our results to the observed
super-Earth population and find that low-density planets are indeed
concentrated in the theoretically allowed region. Our analytical and intuitive
model can be used to investigate possible super-Earth formation scenarios.
