login
Number of length-n 0..2 arrays with no repeated value differing from the previous repeated value by other than one.
1

%I #8 Jan 23 2019 18:28:26

%S 3,9,24,64,164,418,1048,2614,6468,15942,39120,95734,233660,569230,

%T 1384408,3362686,8158932,19778982,47913504,115999462,280698860,

%U 678970558,1641785704,3968834446,9592037508,23178077334,55998523824,135275792374

%N Number of length-n 0..2 arrays with no repeated value differing from the previous repeated value by other than one.

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

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

%F Empirical g.f.: x*(3 - 3*x - 9*x^2 + 7*x^3 + 4*x^4) / ((1 - 2*x)*(1 - 2*x - x^2)*(1 - 2*x^2)). - _Colin Barker_, Jan 23 2019

%e Some solutions for n=9:

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

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

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

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

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

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

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

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

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

%Y Column 2 of A269537.

%K nonn

%O 1,1

%A _R. H. Hardin_, Feb 29 2016