Text this: Differential equations to calculate the ionicity factor of hexagonal structure semiconductors