A320526 a(n) is the number of chiral pairs of color patterns (set partitions) in a row of length n using exactly 3 colors (subsets).
0, 0, 0, 2, 10, 40, 141, 464, 1480, 4600, 14145, 43052, 130480, 393820, 1186521, 3568784, 10725760, 32213200, 96714465, 290284052, 871142800, 2613981700, 7843080201, 23531425304, 70598731840, 211804847800, 635432109585, 1906330676252, 5719061512720, 17157321139180
Offset: 1
Examples
For a(4)=2, the two chiral pairs are AABC-ABCC and ABAC-ABCB.
Links
- Index entries for linear recurrences with constant coefficients, signature (6, -6, -24, 49, 6, -66, 36).
Programs
-
Magma
I:=[0,0,0,2,10,40,141]; [n le 7 select I[n] else 6*Self(n-1) -6*Self(n-2) -24*Self(n-3) +49*Self(n-4) +6*Self(n-5) -66*Self(n-6) +36*Self(n-7): n in [1..40]]; // G. C. Greubel, Oct 16 2018
-
Mathematica
k=3; Table[(StirlingS2[n,k] - If[EvenQ[n], 2StirlingS2[n/2+1,3] - 2StirlingS2[n/2,3], StirlingS2[(n+3)/2,3] - StirlingS2[(n+1)/2,3]])/2, {n, 1, 30}] Ach[n_, k_] := Ach[n, k] = If[n<2, Boole[n==k && n>=0], k Ach[n-2,k] + Ach[n-2,k-1] + Ach[n-2,k-2]] (* A304972 *) k = 3; Table[(StirlingS2[n, k] - Ach[n, k])/2, {n, 1, 30}] LinearRecurrence[{6, -6, -24, 49, 6, -66, 36}, {0, 0, 0, 2, 10, 40, 141}, 40]
-
PARI
m=40; v=concat([0,0,0,2,10,40,141], vector(m-7)); for(n=8, m, v[n] = 6*v[n-1] -6*v[n-2] -24*v[n-3] +49*v[n-4] +6*v[n-5] -66*v[n-6] +36*v[n-7] ); v \\ G. C. Greubel, Oct 16 2018
Formula
a(n) = (S2(n,k) - A(n,k))/2, where k=3 is the number of colors (sets), S2 is the Stirling subset number A008277 and A(n,k) = [n>1] * (k*A(n-2,k) + A(n-2,k-1) + A(n-2,k-2)) + [n<2 & n==k & n>=0].
G.f.: (x^3 / Product_{k=1..3} (1 - k*x) - x^3*(1 + 2 x)/((1 - 2 x^2)*(1 - 3 x^2))) / 2.
Comments