# Creating a list using previous elements

I am new to stack exchange though I have used it to help me through some struggles before. This question I cannot find an answer to.

I'm looking to create a set of polynomials where the 'i'th polynomial is some combination of the previous polynomial and the second previous polynomial. For example.

 Subscript[M, i] =
Subscript[Z, i]*Subscript[M, i - 1] -
Subscript[K, i]^2*Subscript[M, i - 2]


If I provide the first two elements can I generate this list such that I can ask for the 50th polynomial. Grant it the size will be extraordinary. Thanks!

You could do for example

n = 5;
Subscript[m, 1] = Subscript[m, 2] = 1;

Table[Subscript[m, i] =
Subscript[z, i]*Subscript[m, i - 1] -
Subscript[k, i]^2*Subscript[m, i - 2], {i, 3, n}];


which gives

Subscript[m, #] & /@ Range[n] // ColumnForm


• Thank you eldo it appears this works perfectly! I knew it would be a simple fix but I'm too inexperienced to get it yet. Thank you though. Also Kuba thank you for the advice I didn't think to check for recurrence but I will now! Thanks guys – KFGauss Jul 19 '17 at 12:42