%I #28 Oct 15 2018 10:28:02
%S 0,0,0,6,24,72,186,438,990,2142,4560,9492,19620,40068,81534,164892,
%T 332808,669528,1345554,2699448,5412636,10843038,21714972,43467342,
%U 86995428,174069306,348265164,696694692,1393652298,2787646380,5575837836,11152384044,22305891948,44613248352,89228806704,178460625402,356925987924
%N Number of exact 3-colored partitions such that no adjacent parts have the same color.
%C a(1) = a(2) = 0 because we need to use exactly three colors, which means the number of parts should be greater than two.
%C All terms are multiples of 6.
%H Alois P. Heinz, <a href="/A262445/b262445.txt">Table of n, a(n) for n = 0..1000</a>
%H Ran Pan, <a href="http://arxiv.org/abs/1509.06107">A note on enumerating colored integer partitions</a>, arXiv:1509.06107 [math.CO], 2015.
%H Ran Pan, <a href="http://www.math.ucsd.edu/~projectp/warmups/eS.html">Exercise S</a>, Project P.
%F G.f.: 3/2*Product_{k>=1} (1/(1-2*x^k)) - 6*Product_{k>=1} (1/(1-x^k)) + 3/(1-x) + 3/2.
%F a(n) = A262444(n) - 6*A000041(n) + 3, for n >= 1.
%F a(n) = 6 * A262495(n,3). - _Alois P. Heinz_, Sep 24 2015
%e a(3)=6 because there are three partitions of 3 and there are no ways to color [3] or [2,1] but there are six ways to color [1,1,1].
%p b:= proc(n, i, k) option remember; `if`(n=0, 1, `if`(i<1, 0,
%p b(n, i-1, k) +`if`(i>n, 0, k*b(n-i, i, k))))
%p end:
%p a:= n-> `if`(n=0, 0, b(n$2, 2)/2*3-6*b(n$2, 1)+3):
%p seq(a(n), n=0..40); # _Alois P. Heinz_, Sep 23 2015
%t b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i < 1, 0, b[n, i - 1, k] + If[i > n, 0, k*b[n - i, i, k]]]]; a[n_] := If[n == 0, 0, b[n, n, 2]/2*3 - 6*b[n, n, 1] + 3]; Table[a[n], {n, 0, 40}] (* _Jean-François Alcover_, Feb 07 2017, after _Alois P. Heinz_ *)
%Y Cf. A000041, A262444, A139582, A262495, A320545.
%K nonn
%O 0,4
%A _Ran Pan_, Sep 23 2015
|