We study the Einstein-Maxwell system of equations in spherically symmetric gravitational fields for static interior spacetimes. The condition for pressure isotropy is reduced to a recurrence equation with variable, rational coefficients. We demonstrate that this difference equation can be solved in general using mathematical induction. Consequently, we can find an explicit exact solution to the Einstein-Maxwell field equations. The metric functions, energy density, pressure and the electric field intensity can be found explicitly. Our result contains models found previously, including the neutron star model of Durgapal and Bannerji. By placing restrictions on parameters arising in the general series, we show that the series terminate and there exist two linearly independent solutions. Consequently, it is possible to find exact solutions in terms of elementary functions, namely polynomials and algebraic functions.