recursive formulation