Step 1: In a ccp lattice, each unit cell contains 4 atoms of element Y.
Step 2: The number of tetrahedral voids in a ccp structure is also 4, and \( \frac{2}{3} \) of these voids are occupied by element X.
Step 3: Therefore, the number of atoms of element X is \( 4 \times \frac{2}{3} = 3 \), and the number of atoms of element Y is 4. Thus, the formula is \( X_4Y_3 \).
Final Answer:
\[
\boxed{X_4Y_3}
\]