OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (5,-5,-1).
FORMULA
a(n) = 5*a(n-1) - 5a(n-2) - a(n-3), a(0)=1, a(1)=5, a(2)=17.
G.f.: (1 - 3*x^2)/(1 - 5*x + 5*x^2 + x^3).
EXAMPLE
For n=2 the a(2)=17=25-8 sequences contain every combination except these eight: 01,10,12,21,23,32,34,43.
MATHEMATICA
LinearRecurrence[{5, -5, -1}, {1, 5, 17}, 50]
PROG
(Python)
def a(n):
if n in [0, 1, 2]:
return [1, 5, 17][n]
return 5*a(n-1)-5*a(n-2)-a(n-3)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Nacin, Jun 01 2017
STATUS
approved