A209350 Number of initially rising meander words, where each letter of the cyclic n-ary alphabet occurs twice.
1, 0, 1, 5, 9, 11, 16, 19, 25, 29, 36, 41, 49, 55, 64, 71, 81, 89, 100, 109, 121, 131, 144, 155, 169, 181, 196, 209, 225, 239, 256, 271, 289, 305, 324, 341, 361, 379, 400, 419, 441, 461, 484, 505, 529, 551, 576, 599, 625, 649, 676, 701, 729, 755, 784, 811, 841
Offset: 0
Examples
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}|.
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).
Crossrefs
Programs
-
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 *)
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.
Comments