%I #25 May 10 2020 08:29:47
%S 1,1,2,3,7,11,27,43,107,171,427,683,1707,2731,6827,10923,27307,43691,
%T 109227,174763,436907,699051,1747627,2796203,6990507,11184811,
%U 27962027,44739243,111848107,178956971,447392427,715827883,1789569707,2863311531,7158278827
%N Number of achiral color patterns (set partitions) in a row or cycle of length n with 4 or fewer colors (subsets).
%C An equivalent color pattern is obtained when we permute the colors. Thus all permutations of ABCD are equivalent, as are AABCD and BBCDA. A color pattern is achiral if it is equivalent to its reversal. Rotations of the colors of a cycle are equivalent, so for cycles AABBCD = BBCDAA = CDAABB.
%H Muniru A Asiru, <a href="/A305750/b305750.txt">Table of n, a(n) for n = 0..2000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,4,-4).
%F a(n) = Sum_{j=0..4} Ach(n,j), where Ach(n,k) = [n>1] * (k*T(n-2,k) + T(n-2,k-1) + T(n-2,k-2)) + [0<=n<2 & n==k].
%F G.f.: (1 - 3x^2 + x^3) / ((1-x) * (1-4x^2)).
%F a(2m) = S2(m+4,4) - 8*S2(m+3,4) + 22*S2(m+2,4) - 23*S2(m+1,4) + 6*S2(m,4);
%F a(2m-1) = S2(m+3,4) - 7*S2(m+2,4) + 16*S2(m+1,4) - 12*S2(m,4), where S2(n,k) is the Stirling subset number A008277.
%F For m>0, a(2m) = (4 + 5*4^m) / 12.
%F a(2m-1) = (2 + 4^m) / 6.
%F a(n) = 2*A056323(n) - A124303(n) = A124303(n) - 2*A320934(n) = A056323(n) - A320934(n).
%F a(n) = 2*A056354(n) - A056292(n) = A056292(n) - 2*A320744(n) = A056354(n) - A320744(n).
%F a(n) = A057427(n) + A052551(n-2) + A304973(n) + A304974(n).
%F a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3). - _Muniru A Asiru_, Oct 28 2018
%e For a(4) = 7, the achiral row patterns are AAAA, AABB, ABAB, ABBA, ABBC, ABCA, and ABCD. The cycle patterns are AAAA, AAAB, AABB, ABAB, AABC, ABAC, and ABCD.
%p seq(coeff(series((1-3*x^2+x^3)/((1-x)*(1-4*x^2)),x,n+1), x, n), n = 0 .. 40); # _Muniru A Asiru_, Oct 28 2018
%t Table[If[EvenQ[n], StirlingS2[(n+8)/2, 4] - 8 StirlingS2[(n+6)/2, 4] + 22 StirlingS2[(n+4)/2, 4] - 23 StirlingS2[(n+2)/2, 4] + 6 StirlingS2[n/2, 4], StirlingS2[(n+7)/2, 4] - 7 StirlingS2[(n+5)/2, 4] + 16 StirlingS2[(n+3)/2, 4] - 12 StirlingS2[(n+1)/2, 4]], {n, 0, 40}]
%t 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 *)
%t k=4; Table[Sum[Ach[n, j], {j, 0, k}], {n, 0, 40}]
%t (* or *)
%t CoefficientList[Series[(1-3x^2+x^3)/((1-x)(1-4x^2)), {x,0,40}], x]
%t (* or *)
%t Join[{1},LinearRecurrence[{1,4,-4},{1,2,3},40]]
%t (* or *)
%t Join[{1},Table[If[EvenQ[n], (4+5 4^(n/2))/12, (2+4^((n+1)/2))/6], {n,40}]]
%o (GAP) a:=[1,2,3];; for n in [4..40] do a[n]:=a[n-1]+4*a[n-2]-4*a[n-3]; od; Concatenation([1],a); # _Muniru A Asiru_, Oct 28 2018
%Y Fourth column of A305749.
%Y Cf. A124303 (oriented), A056323 (unoriented), A320934 (chiral), for rows.
%Y Cf. A056292 (oriented), A056354 (unoriented), A320744 (chiral), for cycles.
%K nonn,easy
%O 0,3
%A _Robert A. Russell_, Jun 09 2018