Before this is closed for duplicate, know that I have read the following posts:
A product function for matrix products
Taking the product of a list of matrices [duplicate]
I need to multiply a series of matrices
All of these give good answer to the question of multiplying a list of matrices where the number of matrices to be multiplied is known. However, none of these work if I want to keep the number of matrices unknown, i.e. symbolic.
My particular problem is that I have a matrix sequence $A_k = \begin{bmatrix} \psi(k) & \phi(k) \\ 1 & 0 \end{bmatrix}$, and I need to be able to compute the products $\prod_{k=n}^m A_k = A_n A_{n-1}\dots A_{m+1}A_m$, when $m < n$ as a general function of $n$ and $m$.To be clear, $n$ and $m$ are not known, and will never be known throughout the problem, so making a list in the standard way won't work (Mathematica will give "Iterator does not have appropriate bounds" if the bounds are not defined). Is there a way to do this in Mathematica?
Edit: For example, suppose $\psi(k)\equiv0$. Then the product $(\prod_{k=n}^1 A_k)Y_1$ solves the recurrence relation $y_{n+2}=\phi(n)y_n$, with $Y_1 = [y_2 \ y_1]^T$ known. Solving this recurrence relation with Mathematica gives an awful mess. However, one can see that the matrix product $\prod_{k=n}^1 A_k = \begin{bmatrix} \left(\frac{1+(-1)^n}{2}\right)\prod_{j=1}^{\lfloor \frac{n}{2} \rfloor} \phi(2j) & \left(\frac{1+(-1)^{n+1}}{2}\right)\prod_{j=1}^{\lfloor \frac{n+1}{2} \rfloor} \phi(2j-1) \\ \left(\frac{1+(-1)^{n+1}}{2}\right)\prod_{j=1}^{\lfloor \frac{n-1}{2} \rfloor} \phi(2j) & \left(\frac{1+(-1)^n}{2}\right)\prod_{j=1}^{\lfloor \frac{n}{2} \rfloor} \phi(2j-1) \end{bmatrix}$ gives a much simpler solution (though still quite messy), and if we restrict $n$ to being either even or odd, it simplifies even further.
Ideally, I'd like a Mathematica function which could give me a form like this, or at least the simpler form if I add the restriction that $n$ is even or odd. Something like
matrixProduct[A[k],{k,n,1}]
or
matrixProduct[A[k],{k,n,1},Element[k/2,Integers]]
which could at least attempt to spit out a solution in this form.
DifferenceRoot[]
. $\endgroup$