OFFSET
0,4
COMMENTS
In a meander word letters of neighboring positions have to be neighbors in the alphabet, where in a cyclic alphabet the first and the last letters are considered neighbors too. The words are not considered cyclic here.
A word is initially rising if it is empty or if it begins with the first letter of the alphabet that can only be followed by the second letter in this word position.
a(n) is also the number of (2*n-1)-step walks on n-dimensional cubic lattice from (1,0,...,0) to (2,2,...,2) with positive unit steps in all dimensions such that the indices of dimensions used in consecutive steps differ by 1 or are in the set {1,n}.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
G.f.: -(3*x^6-5*x^5-2*x^4+5*x^3+x^2-2*x+1) / ((x+1)*(x-1)^3).
a(n) = (n-1)^2 if n<3, a(n) = (n/2+1)^2 - (n mod 2)*5/4 else.
EXAMPLE
a(0) = 1: the empty word.
a(1) = 0 = |{ }|.
a(2) = 1 = |{abab}|.
a(3) = 5 = |{abacbc, abcabc, abcacb, abcbac, abcbca}|.
a(4) = 9 = |{ababcdcd, abadcbcd, abadcdcb, abcbadcd, abcbcdad, abcdabcd, abcdadcb, abcdcbad, abcdcdab}|.
MAPLE
a:= n-> `if`(n<3, (n-1)^2, (n/2+1)^2 -(n mod 2)*5/4):
seq(a(n), n=0..60);
MATHEMATICA
LinearRecurrence[{2, 0, -2, 1}, {1, 0, 1, 5, 9, 11, 16}, 60] (* Harvey P. Dale, Jan 02 2020 *)
CROSSREFS
KEYWORD
nonn,walk,easy
AUTHOR
Alois P. Heinz, Mar 06 2012
STATUS
approved