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