cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A032120 Number of reversible strings with n beads of 3 colors.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

"BIK" (reversible, indistinct, unlabeled) transform of 3, 0, 0, 0, ...
a(n) is the dimension of the homogeneous component of degree n of the free unital special Jordan algebra on 3 generators (this follows from Cohn 1959). Note that this is no longer true for 4 generators and further. - Vladimir Dotsenko, Mar 31 2025

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.
		

Crossrefs

Column 3 of A277504.
Cf. A000244 (oriented), A032086(n>1) (chiral), A056449 (achiral), A382233 (free Jordan algebras).

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
a(n) = (A000244(n) + A056449(n)) / 2. - Robert A. Russell, Nov 10 2018

Extensions

a(0)=1 prepended by Robert A. Russell, Nov 10 2018