|
|
A032120
|
|
Number of reversible strings with n beads of 3 colors.
|
|
11
|
|
|
1, 3, 6, 18, 45, 135, 378, 1134, 3321, 9963, 29646, 88938, 266085, 798255, 2392578, 7177734, 21526641, 64579923, 193720086, 581160258, 1743421725, 5230265175, 15690618378, 47071855134, 141215033961, 423645101883
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
"BIK" (reversible, indistinct, unlabeled) transform of 3, 0, 0, 0, ...
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (1/2)*((2-(-1)^n)*3^floor(n/2) + 3^n). - Ralf Stephan, May 11 2004
a(n) = 3*a(n-1) + 3*a(n-2) - 9*a(n-3).
G.f.: (1-6x^2) / ((1-3x)*(1-3x^2)). (End) [Adapted to offset 0 by Robert A. Russell, Nov 10 2018]
|
|
EXAMPLE
|
For a(2)=10, the four achiral strings are AA, BB, CC, and DD; the 6 (equivalent) chiral pairs are AB-BA, AC-CA, AD-DA, BC-CB, BD-DB, and CD-DC.
|
|
MATHEMATICA
|
f[n_] := If[EvenQ[n], (3^n + 3^(n/2))/2, (3^n + 3^Ceiling[n/2])/2];
Table[(1/2) ((2 - (-1)^n) 3^Floor[n/2] + 3^n), {n, 0, 25}]. (* Bruno Berselli, Apr 22 2012 *)
|
|
PROG
|
(Magma) I:=[1, 3, 6]; [n le 3 select I[n] else 3*Self(n-1)+3*Self(n-2)-9*Self(n-3): n in [1..25]]; // Vincenzo Librandi, Apr 22 2012
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|