What does applying the indefinite article to a group of things signify?
Inside the box was a pen, pencil and eraser.
Inside the box was a pen, a pencil and an eraser.
Or, perhaps #2 is ungrammatical and you can only use #1?
Inside the box was a pen, pencil and eraser.
Inside the box was a pen, a pencil and an eraser.
Both version #1 and #2 are fine and grammatical in today's standard English.
There could often be a slight difference in nuance of meaning, such that a speaker or writer might prefer one version over the other in different specific contexts.
As seen in version #1: a coordination of nouns can sometimes combine with a singular determiner (e.g. "a") when there is a close association between the coordinates. And so, the writer can choose that version #1 to show that association to the reader.
An example of this close association is "a cup and saucer", which will usually be preferred over "a cup and a saucer" (but not necessarily always, see next paragraph).
But the speaker or writer might intentionally choose version #2 if they want to emphasize the individuality of each coordinate (e.g. noun). This might happen if the context is one where a character is identifying each item, one at a time, and each item is important in its own right. (In such a context, a writer might choose to write "a cup and a saucer"; perhaps if the cup is not on the saucer or they don't match each other, and the writer thinks that is significant.)
ADDED: I would like to emphasize that sentences like version #2 will in general often be used, as they make no requirement that the coordinates have a close association among them. (E.g. "The barn contained a copying machine and a horse" -- the second article "a" is most likely required due to that lack of close association of coordinates.) And they will sometimes be used even if there is a close association among the coordinates.
As to sentences like version #1, in general, usually, there will be a close association among the coordinates. (E.g. "His shirt pocket held a pencil and pen".)
In general there are restrictions on coordinations of nouns as to how they can combine with determiners.
For more related info, there's the 2002 reference grammar by Huddleston and Pullum et al., The Cambridge Grammar of the English Language (CGEL), section "Number constraints on coordination of nouns", pages 1334-5.
I think in example (ii) you meant to use the verb, was. But, concerning the indefinite article, example (i) is sufficient. The article doesn't need to be repeated. Example (ii) is grammatically correct, but repeating articles in a list isn't really necessary.
Inside the box was a pen, two pencils, and an eraser.
Commented
Nov 17, 2014 at 20:53
When you are using an indefinite article for a group then the group is considered to be only one thing and not different things.
See examples
Another example
(Here you can not use 'an industriliast and a politician' because 'he' is not two people but only one)
So in your example in the first sentence 'Inside the box was a pen, pencil and eraser.' is incorrect because you are talking about three different things and not just a single thing. So every different thing needs a seperate article.