A generator for linear recurrence equations (homogenous and nonhomogenous)