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.
%I A304974 #26 Sep 08 2022 08:46:21 %S A304974 0,0,0,0,1,2,9,16,53,90,265,440,1221,2002,5369,8736,22933,37130,96105, %T A304974 155080,397541,640002,1629529,2619056,6636213,10653370,26899145, %U A304974 43144920,108659461,174174002,437826489,701478976,1760871893,2820264810,7072185385,11324105960,28374834981,45425564002,113757620249 %N A304974 Number of achiral color patterns (set partitions) for a row or loop of length n using exactly 4 colors (sets). %C A304974 Two color patterns are equivalent if we permute the colors. Achiral color patterns must be equivalent if we reverse the order of the pattern. %H A304974 G. C. Greubel, <a href="/A304974/b304974.txt">Table of n, a(n) for n = 0..1000</a> %H A304974 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,7,-7,-12,12). %F A304974 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). %F A304974 G.f.: x^4 * (1+x)^2 * (1-2x^2) / Product_{k=1..4} (1 - k*x^2). %F A304974 a(n) = A304972(n,4). %F A304974 a(2m-1) = A140735(m,4). %F A304974 a(2m) = A293181(m,4). %e A304974 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. %t A304974 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}] %t A304974 Join[{0}, LinearRecurrence[{1, 7, -7, -12, 12}, {0, 0, 0, 1, 2}, 40]] (* _Robert A. Russell_, Oct 14 2018 *) %o A304974 (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 %o A304974 (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 %Y A304974 Fourth column of A304972. %Y A304974 Fourth column of A140735 for odd n. %Y A304974 Fourth column of A293181 for even n. %Y A304974 Coefficients that determine the first formula and generating function are row 4 of A305008. %K A304974 nonn,easy %O A304974 0,6 %A A304974 _Robert A. Russell_, May 22 2018