login
Number of length-n 0..2 arrays with no repeated value differing from the previous repeated value by other than plus two, zero or minus 1.
2

%I #7 Mar 21 2018 17:19:50

%S 3,9,27,78,222,624,1740,4824,13320,36672,100752,276384,757344,2073600,

%T 5674176,15520128,42437760,116014080,317100288,866621952,2368230912,

%U 6471278592,17682164736,48313178112,132003268608,360658059264

%N Number of length-n 0..2 arrays with no repeated value differing from the previous repeated value by other than plus two, zero or minus 1.

%C Column 2 of A269619.

%H R. H. Hardin, <a href="/A269613/b269613.txt">Table of n, a(n) for n = 1..210</a>

%F Empirical: a(n) = 4*a(n-1) - 2*a(n-2) - 4*a(n-3).

%F Conjectures from _Colin Barker_, Mar 21 2018: (Start)

%F G.f.: 3*x*(1 - x - x^2) / ((1 - 2*x)*(1 - 2*x - 2*x^2)).

%F a(n) = (-3*2^n + (3-2*sqrt(3))*(1-sqrt(3))^n + (1+sqrt(3))^n*(3+2*sqrt(3))) / 4.

%F (End)

%e Some solutions for n=8:

%e ..1. .1. .0. .0. .0. .1. .1. .1. .2. .2. .2. .1. .1. .1. .0. .1

%e ..2. .1. .0. .0. .2. .2. .1. .2. .1. .0. .0. .0. .1. .2. .2. .0

%e ..2. .0. .0. .1. .2. .1. .0. .1. .2. .0. .2. .2. .2. .1. .0. .1

%e ..2. .1. .1. .2. .2. .1. .1. .1. .0. .2. .1. .1. .1. .2. .0. .0

%e ..2. .2. .2. .0. .1. .0. .1. .0. .1. .0. .1. .1. .0. .0. .1. .0

%e ..2. .0. .2. .2. .2. .0. .1. .1. .1. .0. .2. .2. .1. .2. .2. .1

%e ..1. .0. .1. .0. .1. .2. .0. .1. .1. .1. .0. .0. .1. .1. .2. .2

%e ..1. .0. .1. .2. .0. .1. .0. .1. .1. .2. .2. .1. .0. .2. .1. .1

%Y Cf. A269619.

%K nonn

%O 1,1

%A _R. H. Hardin_, Mar 01 2016