OFFSET
0,2
COMMENTS
a(n) is the number of words of length n, x(1)x(2)...x(n), on the alphabet {0,1,2,3} such that, for i=2,...,n, x(i)=either x(i-1) or x(i-1)-1.
For the bijection between arrays and words, notice that the i-th column consists of 1's and then 0's, and there are x(i)=0 to 3 1's. - Miquel A. Fiol, Feb 06 2024
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000 (terms n = 1..200 from R. H. Hardin)
FORMULA
Proved (for the number of sequences): a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). (From this, the formulas below follow.) - Miquel A. Fiol, Feb 06 2024
a(n) = (1/6)*n^3 + (11/6)*n + 2 for n>=1.
G.f.: -(x^4 - 4*x^3 + 3*x^2 - 1)/(x - 1)^4. - Colin Barker, Mar 18 2012
EXAMPLE
Some solutions for 3 X 3:
1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1
0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1
0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 1 1 1
For n=3, the a(3)=12 solutions are 000, 100, 110, 210, 111, 211, 221, 321, 222, 322, 332, 333. Those corresponding to the above arrays are 110, 221, 322, 222, 332, 000, 333 (as mentioned, consider the sums of the columns of each array). - Miquel A. Fiol, Feb 06 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
R. H. Hardin, Apr 04 2011
EXTENSIONS
a(0)=1 prepended by Alois P. Heinz, Feb 10 2024
STATUS
approved