Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Tasks