Sum rules for free energy and frequency distribution of DNA dinucleotides