请参考

https://www.cnblogs.com/Troywar/p/9078013.html  「常系数齐次线性递推」——矩阵快速幂的优化

https://blog.csdn.net/corsica6/article/details/82696715   常系数齐次线性递推优化矩阵快速幂-bzoj4161-4944

https://www.luogu.org/blog/Zhang-RQ/chang-ji-shuo-ji-ci-xian-xing-di-tui-chu-tan    常系数齐次线性递推初探