A032120 Number of reversible strings with n beads of 3 colors.
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
Offset: 0
Examples
For a(2)=6, the three achiral strings are AA, BB, CC; the three (equivalent) chiral pairs are AB-BA, AC-CA, BC-CB. In the language of special Jordan algebras, the three latter correspond to the Jordan products (AB+BA)/2, (AC+CA)/2, (BC+CB)/2.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- C. G. Bower, Transforms (2)
- P. M. Cohn, Two embedding theorems for Jordan algebras, Proceedings of the London Mathematical Society, Volume s3-9, Issue 4, October 1959, pp. 503-524.
- Index entries for linear recurrences with constant coefficients, signature (3,3,-9).
Crossrefs
Programs
-
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
-
Mathematica
f[n_] := If[EvenQ[n], (3^n + 3^(n/2))/2, (3^n + 3^Ceiling[n/2])/2]; Table[f[n],{n,0,25}] (* Geoffrey Critzer, Apr 24 2011 *) CoefficientList[Series[(1-6x^2)/((1-3x) (1-3x^2)), {x, 0, 30}], x] (* Vincenzo Librandi, Apr 22 2012 *) (* Adapted to offset 0 by Robert A. Russell, Nov 10 2018 *) Table[(1/2) ((2 - (-1)^n) 3^Floor[n/2] + 3^n), {n, 0, 25}] (* Bruno Berselli, Apr 22 2012 *) LinearRecurrence[{3, 3, -9}, {1, 3, 6}, 31] (* Robert A. Russell, Nov 10 2018 *)
-
PARI
a(n) = (3^n + 3^(ceil(n/2)))/2; \\ Andrew Howroyd, Oct 10 2017
Formula
a(n) = (1/2)*((2-(-1)^n)*3^floor(n/2) + 3^n). - Ralf Stephan, May 11 2004
For n>0, a(n) = 3 * A001444(n-1). - N. J. A. Sloane, Sep 22 2004
From Colin Barker, Apr 02 2012: (Start)
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]
a(n) = (1/2)*(3^(ceiling(n/2)) + 3^n). - Andrew Howroyd, Oct 10 2017
Extensions
a(0)=1 prepended by Robert A. Russell, Nov 10 2018
Comments