Is there a mathematical formula for electronegativity?
Electronegativity cannot be calculated from the number of subatomic particles in an atom. However, using Ionization Energy and Electron Affinity, one can calculate the Electronegativity of an atom using the Mulliken Electronegativity Equation.

Ionization Energy : The amount of energy required to remove the
electron that is least attracted to the nucleus in a gaseous state.
Electron Affinity : The amount of energy an atom gains when an
electron is added.

To find the Ionization and Electron Affinity values of an atom, one must reference a chart.  In the Mulliken Electronegativity Equation, Ei stands for Ionization Energy and Eea stands for Electron Affinity.  Plug in your values and solve.

Equation for Energies in Kilojoules/Mole :
ENMulliken = (1.97×10^−3)(Ei+Eea) + 0.19
Equation for Energies in Electronvolts :
ENMulliken = 0.187(Ei+Eea) + 0.17

Lithium Example in kJ/mol :

The Ionization Energy for Lithium is 520 kJ/mol
The Electron Affinity for Lithium is 60 kJ mol^-1
ENMulliken = (1.97×10^−3)(Ei+Eea) + 0.19
ENMulliken = (1.97×10^−3)(520 + 60) + 0.19
ENMulliken = 1.143 + 0.19 = 1.333


NOTE : There are multiple scales for measuring Electronegativity, including the Pauling Scale, Sanderson, Allen, and more.  This example measures Electronegativity using the Mulliken scale, and will compute an answer that will differ from other models.