RSolve[y[n + 2] + 1/( n^2 + 1) y[n + 1] + y[n] == Mod[n, 3] && y[0] == y[1] == 1, y[n], n]
RSolve[y[n + 2] + 1/( n^2 + 1) y[n + 1] + y[n] == Mod[n, 3] && y[0] == y[1] == 1, y[n], n]; DiscretePlot[Evaluate[y[n] /. First[%]], {n, 0, 50}]