# [Pari/GP], 48 bytes The generating function of the sequence is: $$\frac{(n-1)x^n}{x^{n+1}-2x+1}-\frac{1}{x-1}$$ (n,m)->Vec(x^n/((x^n-2)*x+1)*n---1/(x-1)+O(x^m)) [Try it online!][TIO-jozd53cl] [Pari/GP]: http://pari.math.u-bordeaux.fr/ [TIO-jozd53cl]: https://tio.run/##FclBCoMwEIXhqwyuZnQGHdNiN/UK3XUjKQSpRYghSBfp6dNk8/gef3TnLp@YN7hnDHyQzM/3iukVeqwrI7WpU2qDiGiPSZS6RykHUXYx@h86kBniuYdvYVNPA6vzHjcGR8SwLIbhZgsmBjUVyjAOFWZguFRcS1JrKf8B "Pari/GP – Try It Online"