Why is atomic number represented by Z?
The symbol for atomic number, Z, stands for "Zahl", which means number in German.
Prior to 1915, the symbol Z denoted the position of an element in the periodic table. Once there was evidence that this was also the charge of the atom, Z came to be called "Atomzahl", or atomic number.
M is sometimes used for mass number ("Massenzahl" in German), but A is the symbol recommended in the ACS Style Guide.