%I #34 Sep 29 2018 03:05:52
%S 0,0,0,3,6,21,36,93,150,345,540,1173,1806,3801,5796,11973,18150,37065,
%T 55980,113493,171006,345081,519156,1044453,1569750,3151785,4733820,
%U 9492213,14250606,28550361,42850116,85798533,128746950,257690505,386634060,773661333
%N Number of periodic palindromes using exactly three different symbols.
%C For example, aaabbb is not a (finite) palindrome but it is a periodic palindrome.
%D M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]
%H Vincenzo Librandi, <a href="/A056489/b056489.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,5,-5,-6,6).
%F a(n) = 2 * A056343(n) - A056283(n).
%F G.f.: 3*x^4*(1+x)/((1-x)*(1-2*x^2)*(1-3*x^2)). - _Colin Barker_, May 06 2012
%F a(n) = (k!/2)*(S2(floor((n+1)/2),k) + S2(ceiling((n+1)/2),k)), with k=3 different colors used and where S2(n,k) is the Stirling subset number A008277. - _Robert A. Russell_, Jun 05 2018
%e For n=4, the three arrangements are ABAC, ABCB, and ACBC.
%e For n=5, the six arrangements are AABCB, AACBC, ABACC, ABBAC, ABCCB, and ACBBC.
%p seq(coeff(series(3*x^4*(1+x)/((1-x)*(1-2*x^2)*(1-3*x^2)),x,n+1), x, n), n = 1..40); # _Muniru A Asiru_, Sep 28 2018
%t k = 3; Table[(k!/2) (StirlingS2[Floor[(n + 1)/2], k] +
%t StirlingS2[Ceiling[(n + 1)/2], k]), {n, 1, 40}] (* _Robert A. Russell_, Jun 05 2018 *)
%t LinearRecurrence[{1, 5, -5, -6, 6}, {0, 0, 0, 3, 6}, 80] (* _Vincenzo Librandi_, Sep 27 2018 *)
%o (PARI) a(n) = my(k=3); (k!/2)*(stirling(floor((n+1)/2), k, 2) + stirling(ceil((n+1)/2), k, 2)); \\ _Michel Marcus_, Jun 05 2018
%o (GAP) a:=[0,0,0,3,6];; for n in [6..40] do a[n]:=a[n-1]+5*a[n-2]-5*a[n-3]-6*a[n-4]+6*a[n-5]; od; a; # _Muniru A Asiru_, Sep 28 2018
%Y Cf. A056454.
%Y Column 3 of A305540.
%K nonn,easy
%O 1,4
%A _Marks R. Nester_
|