Here's the general equation for the rusting of iron (nails are typically made of iron):
4 Fe + 3 O₂ + 6 H₂O → 2 Fe₂O₃ • 3 H₂O
This equation shows:
* 4 Fe (four iron atoms) react with
* 3 O₂ (three oxygen molecules) and
* 6 H₂O (six water molecules) to produce
* 2 Fe₂O₃ • 3 H₂O (two molecules of hydrated iron(III) oxide, which is rust).
It's important to note that this is a simplified representation of the complex chemical reactions that occur during rusting.