What is the charge on the theoretical element #X# that forms a cation with a oxygen and the formula of its oxide is #X_2O#?
The important thing to remember about ionic compounds is that they are electrically neutral.
This means that the overall positive charge coming from the cations must be balanced by the overall negative charge coming from the anions.
Now, your theoretical element
Notice that the formula of the compound is
Well, if you have two
So, one formula unit for this oxide will contain two