When nitrogen and aluminum form an ionic bond, the formula of the ionic compound is AlN.
Aluminum forms a cation Al⁺³ and nitrogen forms an anion N⁻³. When each cation of Al⁺³ combines with an anion of N⁻³, AlN or aluminum nitride is formed. In AlN a strong electrostatic force of attraction exists between the oppositely charged Al⁺³ and N⁻³ ions.