Clarification:
Within a hexagonal close-packed (HCP) unit cell, the ratio of lattice points to octahedral and tetrahedral holes is 1: 1: 2.
Defining the:
Number of lattice points = 1x.
Number of octahedral points = 1x
Number of tetrahedral points = 2x
Assuming anions occupy the HCP lattice points and cations fill half of the tetrahedral holes.
The number of anions in the HCP lattice points, A= 1x
The cation count at tetrahedral points, B = 
Thus, the compound's formula will be = 
If anions occupy the HCP lattice points and cations take all of the tetrahedral holes, the number of anions remains as A= 1x
The count of cations at tetrahedral points would now be B = 2x
Thus, the formula for the compound will be = 