Another way in Mathematica 6 or later.
B: = Flatten[ConstantArray @@@ a]
Output = {2, 3, 7, 11, 11, 13, 23, 23, 31, 41}
even shorter:
Join @@ ConstantArray @@@ a
Comparison of speed of submitted methods
Using these functions (in the order they are placed):
zvrba = Flatten[Map[Table[#[[1]], {#[[2]]}] &, #]] &; dreeves = Sequence @@ Table[#1, {#2}] & @@@ # &; gdelfino = Flatten[# /. {p_, n_} :> Table[p, {n}]] &; mrwizard = Join @@ ConstantArray @@@ # &; sasha = Function[{p, e}, Array[p &, e, 1, Sequence]] @@@ # &;
and assigning them the letters Z, D, G, M, S, respectively, here are graphs of their effectiveness.
Firstly, to increase the number of input lists:

Secondly, to increase the indicator (repetition length) in each list:

Please note that these diagrams are logarithmic. The lower the better.
Mr. Wizard
source share