The ratio between the number of molecules will be 2:7.
You know that the mixture contains oxygen and nitrogen in a 1:4 mass ratio. You can write this as
#m_(O_2)/m_(N_2) = 1/4#
The mass of the two gases can be expressed using their respective molar masses and the number of moles of each present in the mixture
#m = "number of moles"/"molar mass"#
#m_(O_2) = n_(O_2)/"32.0 g/mol"#
#m_(N_2) = n_(N_2)/("28.0 g/mol")#
This means that the mass ratio that exists between the two gases can be written as
#m_(O_2)/m_(N_2) = n_(O_2)/(32.0cancel("g/mol")) * (28.0cancel("g/mol"))/n_(N_2) = n_(O_2)/n_(N_2) = 1/4#
#(7 * n_(O_2))/(8 * n_(N_2)) = 1/4 => n_(O_2)/n_(N_2) = 8/28 = 2/7#
One mole of any substance contains exactly #6.022 * 10^(23)# atoms or molecules of that substance - this is known as Avogadro's number.
In order to have 1 mole of oxygen, you need to have #6.022 * 10^(23)# molecules of oxygen. Likewise, 1 mole of nitrogen must contain #6.022 * 10^(23)# molecules of nitrogen.
So, if your gaseous mixture contains oxygen and nitrogen in a #2:7# mole ratio, then the ratio between the number of molecules of each gas must be equal to 2:7 as well.
Regardless of how many moles of oxygen you actually have, the 2:7 ratio you have between the two gases applies to the number of molecules too.
For example, if you have 0.5 moles of oxygen and 1.75 moles of nitrogen, you'd get
#0.5cancel("moles"O_2) * (6.022 * 10^(23)"molecules")/(1cancel("mole"O_2)) = 3.011 * 10^(23)"molecules"# #O_2#
and
#1.75cancel("moles"N_2) * (6.022 * 10^(23)"molecules"N_2)/(1cancel("mole"N_2)) = 10.5385 * 10^(23)"molecules"# #N_2#
DIvide these two numbers to get
#(3.011 * cancel(10^(23)))/(10.5385 * cancel(10^(23))) = 2/7# #-># the molecule ratio is equal to the mole ratio