Why do we use coefficients for RFM (relative formula mass) in atom economy?
Before we come to your actual question, we should clarify a few other problems related to quantities and units in your expression:


  moles = mass / RFM


It is essential to distinguish between quantities and units. For example, density is defined as “mass per volume” and not “mass per litre”. In your expression “moles” is a unit name; but it should actually be the quantity “amount of substance”:


  amount of substance =  mass / RFM


Names of quantities (such as “amount of substance” and “mass”) shall not be arranged in the form of an equation. You should use the corresponding quantity symbols:


  n = m / RFM


It is not permissible to use abbreviations (such as “RFM”) for unit symbols (“Mr”) or unit names (“relative molecular mass”).


  n = m / Mr


There shall be a space on both sides of most operators but not for the solidus “/”. 


  n = m/Mr


And finally, your equation is wrong, since amount of substance is not given as mass per relative molecular mass. Remember that relative molecular mass is a dimensionless quantity. Actually, amount of substance is given as mass per molar mass:


  n = m/M




Now coming to your actual question.

Atom economy is defined as the quotient of relative molecular mass of the desired product by relative molecular mass of all reactants.

Thus, for a simple reaction

$$\ce{A + B -&gt; Y + W}$$

where $\ce{Y}$ is the desired product and $\ce{W}$ is a by-product that becomes waste, the atom economy would be

$$x=\frac{M_\mathrm r(\ce{Y})}{M_\mathrm r(\ce{A})+M_\mathrm r(\ce{B})}$$

However, for a slightly different reaction

$$\ce{C + D -&gt; 2 Y + V}$$

you would get two molecules of the desired product $\ce{Y}$ for each molecule of the reactant $\ce{C}$ and for each molecule of the reactant $\ce{D}$. The yield of product per used amount of reactants is twice as high; therefore, the atom economy is twice as high:

$$x=\frac{2M_\mathrm r(\ce{Y})}{M_\mathrm r(\ce{C})+M_\mathrm r(\ce{D})}$$

In the same way, any other coefficients in the chemical equation would have to be taken into account.