Step 1: Recall the void formulas.
In a close-packed solid with $N$ atoms, the number of tetrahedral voids is $2N$ and the number of octahedral voids is $N$. We use the tetrahedral count here.
Step 2: Set up the B atoms.
Let the hcp lattice of element B contain $N$ atoms. So the number of B atoms is $N$.
Step 3: Count the tetrahedral voids.
Since tetrahedral voids are twice the number of packed atoms, there are $2N$ tetrahedral voids in this lattice.
Step 4: Find the A atoms.
Element A fills $\tfrac{2}{3}$ of the tetrahedral voids, so \[ A = \frac{2}{3}\times 2N = \frac{4N}{3}. \]
Step 5: Form the ratio A to B.
\[ A : B = \frac{4N}{3} : N. \] Dividing by $N$ gives $\tfrac{4}{3} : 1$, and multiplying by $3$ gives $4 : 3$.
Step 6: Write the formula.
A ratio of $4$ to $3$ means the formula is \[ \boxed{A_4B_3} \]