Alloy-component weight based on desired molecule
Yes, you are correct.

7.692 g / (20 g/mol) = 0.3846 mol X (or 2.316 * 10^23 atoms X)

2.308 g / (3 g/mol) = 0.7693 mol Y (or 4.633 * 10^23 atoms Y)

Moles are just a count of atoms, so if you have two moles of Y per mole of X, you have two Y atoms per X atom.