OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (4, 1, -6).
FORMULA
For n>0, a(n) = 4*a(n-1) + a(n-2) - 6*a(n-3), a(1)=5, a(2)=19, a(3)=73.
G.f.: (1 + x - 2*x^2 - 2*x^3)/(1 - 4*x - x^2 + 6*x^3).
EXAMPLE
For n=2 the a(2)=19=25-6 sequences contain every combination except these six: 02,20,13,31,24,42.
MATHEMATICA
LinearRecurrence[{4, 1, -6}, {1, 5, 19, 73}, 40]
PROG
(Python)
def a(n):
.if n in [0, 1, 2, 3]:
..return [1, 5, 19, 73][n]
.return 4*a(n-1)+a(n-2)-6*a(n-3)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Nacin, Jun 01 2017
STATUS
approved