  The formation of planetary cores must proceed rapidly in order for the giant
planets to accrete their gaseous envelopes before the dissipation of the
protoplanetary gas disc (<3 Myr). In orbits beyond 10 AU, direct accumulation
of planetesimals by the cores is too slow. Fragments of planetesimals could be
accreted faster, but planetesimals are likely too large for fragmentation to be
efficient, and resonant trapping poses a further hurdle. Here we instead
investigate the accretion of small pebbles (mm-cm sizes) that are the natural
outcome of an equilibrium between the growth and radial drift of particles. We
construct a simplified analytical model of dust coagulation and pebble drift in
the outer disc, between 5 AU and 100 AU, which gives the temporal evolution of
the solid surface density and the dominant particle size. These two key
quantities determine how core growth proceeds at various orbital distances. We
find that pebble surface densities are sufficiently high to achieve the
inside-out formation of planetary cores within the disc lifetime. The overall
efficiency by which dust gets converted to planets can be high, close to 50 %
for planetary architectures similar to the Solar System. Growth by pebble
accretion in the outer disc is sufficiently fast to overcome catastrophic Type
I migration of the cores. These results require protoplanetary discs with large
radial extent (~100 AU) and assume a low number of initial seed embryos. Our
findings imply that protoplanetary discs with low disc masses, as expected
around low-mass stars (<1 M_sun), or with sub-solar dust-to-gas ratios, do not
easily form gas-giant planets (M > 100 M_E), but preferentially form
Neptune-mass planets or smaller (< 10 M_E). This is consistent with exoplanet
surveys which show that gas giants are relatively uncommon around stars of low
mass or low metallicity.
