we present the items (pencils and pen) as separate. In this structure, "and" coordinates two sentences, each of which must therefore have its own appropriate verb – though the second verb has disappeared through ellipsis:
There is a pen and (there are) two pencils.
There are one pen and two pencils.
we present the items as a set. In this structure, "and" coordinates two nouns:
There are (one pen and two pencils).
But we can cheat a little:
There are two pencils and one pen.
Student or Learner