A287804 Number of quinary sequences of length n such that no two consecutive terms have distance 1.
1, 5, 17, 59, 205, 713, 2481, 8635, 30057, 104629, 364225, 1267923, 4413861, 15365465, 53490097, 186209299, 648230545, 2256616133, 7855718641, 27347281995, 95201200637, 331413874569, 1153716087665, 4016309864843, 13981555011321, 48672509644725
Offset: 0
Examples
For n=2 the a(2)=17=25-8 sequences contain every combination except these eight: 01,10,12,21,23,32,34,43.
Links
- Index entries for linear recurrences with constant coefficients, signature (5,-5,-1).
Crossrefs
Programs
-
Mathematica
LinearRecurrence[{5, -5, -1}, {1, 5, 17}, 50]
-
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)
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).
Comments