Solution of inversion of Ewald sum for effective ion-electron interaction