I am asking this question here because i think this is fundamentally linked to physics as it revolves around around dimensional analysis and physical quantities.
Background: Amount of substance is a fundamental physical quantity which has mole (mol) as it's SI unit. Therefore all expressions for amount of substance should have the unit mole (or any unit for amount of substance) on simplification if mole (or any other unit for amount of substance as stated before) is taken as the unit for amount of substance.
In short, the all expressions for amount of substance should have the unit for amount of substance on simplification (if necessary). In this question i will use the SI unit for amount of substance, i.e., mole for all purposes.
If $A$ = Amount of substance (in moles), $m$ = Mass of the substance in a particular unit (normally in grams), $M$ = Mass per unit amount of substance (normally in grams/mole)
then,
$\begin{align}\tag1\label1 A = \frac{m}{M} \end{align}$
If the substance is in molecular form, then M is known as molar mass of the substance.
But in my textbook and in many websites on the internet, I have encountered the phrase number of moles. I think it refers to the amount of substance or may be the numerical part in the amount of substance. The formulas given there were strange. One of the formulas for amount of substance was as follows:
If $n$ is the number of moles, $m$ is the mass of the substance in grams and $x$ is the atomic weight (for atoms of elements) or molecular weight (for molecules of elements and compounds), then,
$\begin{align}\tag2\label2 n = \frac{m}{x} \end{align}$
This equation is not dimensionally correct if I am right.
My questions:
First of all i would like to ask whether amount of substance and number of moles refer to the same thing or is it that amount of substance has a unit along with a numerical value whereas number of moles does not have a unit and represents the numerical value in the magnitude of the amount of substance.
Secondly, between equations $\ref1$ and $\ref2$, which one is completely correct (both in meaning and dimension)?
Thirdly, since in some place I have encountered gram atomic/molecular mass in place of molar mass, i would like to know what are the differences between both and do they have the same units or different units?