No, you would not expect both samples to have the same number of atoms. The number of atoms in a sample depends on the molar mass of the element and the amount of substance present. The molar mass of an element is the mass of one mole of atoms of that element.
Since the molar masses of different elements are usually different, 10 grams of one element will not necessarily have the same number of atoms as 10 grams of another element. The molar mass allows us to convert between grams and moles of a substance.
To determine the number of atoms in a sample, you need to know the molar mass of the element and use the concept of moles. One mole of any substance contains Avogadro's number of particles, which is approximately 6.022 x 10^23. So, if you know the molar mass of an element, you can calculate the number of moles in a given mass and then multiply by Avogadro's number to find the number of atoms.
In summary, to determine the number of atoms in a sample, you need to consider the molar mass of the element and the amount of substance (in moles), not just the mass.