Why is AlMg3 called aluminum alloy?
AlMg3 is not the chemical formula of the alloy, it's the product name for a wrought alloy. Its technical sheet specifies the following composition:

Product name
AlMg3
Class of product
Al-Mg alloy for MIG/TIG welding.
Corresponding standards
DIN 1732, SG-AlMg3, AWS A5.10, ER 5754
Nominal composition (weight %)
Al: Bal. Si: 0.4 Mg: 3 Mn: 0.5

Thus, the 3 in the product name refers to 3 % (in weight) of magnesium.