A transition from a twice-folded structure to a hairpin in oligo(dG) in the presence of magnesium ions.