Analytical formulas representing track-structure simulations on DNA damage induced by protons and light ions at radiotherapy-relevant energies