Abstract: Pension plans represent a current relevant topic in a large number of national economies. For example, in Spain its sustainability has been questioned in last years and some actions have been addressed and discussed to maintain the public pension plans conditions to some extent. In the present paper we address the modeling, mathematical analysis and numerical methods for the pricing of pension plans with defined benefits linked to the average salary. Thus, first we define the financial conditions involved in the pension plan we are dealing with, which is mainly indexed to the average salary in the last years near retirement. We consider pension plans with and without early retirement. Concerning the salary evolution, the governing stochastic differential equation can incorporate or not the presence or not of jumps in its dynamics. By means of stochastic Ito calculus and the dynamic hedging methodologies we derive either initial-boundary value problems or complementarity formulations associated to second order degenerate partial differential equations (PDEs) or partial integro-differential equations (PIDE), depending on the assumptions on the pension plan conditions and on the salary evolution models. After stating the different models, the mathematical analysis leading to existence and uniqueness of solution will be developed. Moreover, efficient numerical methods are proposed to solve the PDE and PIDE problems and therefore approximate the value of the pension plan, and also the optimal retirement boundary when early retirement is allowed.