Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ternary recurrence sequence

Is there a built in general recurrence sequence function like the binary recurrence sequence?

def a(n): return BinaryRecurrenceSequence(a,b,c,d)

returns the sequence $U_0=c$, $U_1=d$, and $U_n=aU_{n-1}+bU_{n-2}$.

I would like something that returns $U_n=aU_{n-1}+bU_{n-2}+cU_{n-3}$

Any help is much appreciated!

ternary recurrence sequence

Is there a built in general recurrence sequence function like the binary recurrence sequence?

def a(n):
 return BinaryRecurrenceSequence(a,b,c,d)

BinaryRecurrenceSequence(a,b,c,d)

returns the sequence $U_0=c$, $U_1=d$, and $U_n=aU_{n-1}+bU_{n-2}$.

I would like something that returns $U_n=aU_{n-1}+bU_{n-2}+cU_{n-3}$

Any help is much appreciated!