OFFSET
0,6
COMMENTS
Two color patterns are equivalent if we permute the colors. Achiral color patterns must be equivalent if we reverse the order of the pattern.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,7,-7,-12,12).
FORMULA
a(n) = [n==0 mod 2] * (S2(n/2+2, 4) - S2(n/2+1, 4) - 2*S2(n/2, 4)) + [n==1 mod 2] * (2*S2((n+3)/2, 4) - 4*S2((n+1)/2, 4)) where S2(n,k) is the Stirling subset number A008277(n,k).
G.f.: x^4 * (1+x)^2 * (1-2x^2) / Product_{k=1..4} (1 - k*x^2).
a(n) = A304972(n,4).
a(2m-1) = A140735(m,4).
a(2m) = A293181(m,4).
EXAMPLE
For a(6) = 9, the row color patterns are AABCDD, ABACDC, ABBCCD, ABCADC, ABCBCD, ABCCBD, ABCCDA, ABCDAB, and ABCBCD. The loop color patterns are AAABCD, AABBCD, AABCCD, AABCDB, ABABCD, ABACAD, ABACBD, ABACDC, and ABCADC.
MATHEMATICA
Table[If[EvenQ[n], StirlingS2[n/2 + 2, 4] - StirlingS2[n/2 + 1, 4] - 2 StirlingS2[n/2, 4], 2 StirlingS2[(n + 3)/2, 4] - 4 StirlingS2[(n + 1)/2, 4]], {n, 0, 40}]
Join[{0}, LinearRecurrence[{1, 7, -7, -12, 12}, {0, 0, 0, 1, 2}, 40]] (* Robert A. Russell, Oct 14 2018 *)
PROG
(PARI) m=40; v=concat([0, 0, 0, 1, 2], vector(m-5)); for(n=6, m, v[n] = v[n-1] +7*v[n-2] -7*v[n-3] -12*v[n-4] +12*v[n-5]); concat([0], v) \\ G. C. Greubel, Oct 17 2018
(Magma) I:=[0, 0, 0, 1, 2]; [0] cat [n le 5 select I[n] else Self(n-1) +7*Self(n-2) -7*Self(n-3) -12*Self(n-4) +12*Self(n-5): n in [1..40]]; // G. C. Greubel, Oct 17 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Robert A. Russell, May 22 2018
STATUS
approved