login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

The sum of the coefficients of x^k in the expansion of (x + x^2 + x^3 + x^4 + x^5 + x^6)^n with k divisible by 4.
1

%I #35 Aug 30 2024 10:18:38

%S 1,9,55,322,1946,11664,69980,419912,2519416,15116544,90699280,

%T 544195552,3265173536,19591041024,117546246080,705277476992,

%U 4231664861056,25389989167104,152339935002880,914039610015232,5484237660094976,32905425960566784,197432555763399680

%N The sum of the coefficients of x^k in the expansion of (x + x^2 + x^3 + x^4 + x^5 + x^6)^n with k divisible by 4.

%C a(n) is the number of ways that the sum of n labeled 6-sided dice is divisible by 4. This is important for the game called Mahjong, where the remainder of the sum of n randomly rolled dice when divided by 4 determines the starting player. Usually n=3.

%H Paolo Xausa, <a href="/A362365/b362365.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (4,10,12).

%F a(n) = (1/4)*6^n + (2^(n/2-1))*cos(3*Pi*n/4).

%F a(n) = (1/4)*(6^n + (-1+i)^n + (-1-i)^n), where i is the imaginary unit.

%F a(n) = (1/4)*(A000400(n) + 2*A009116(n)).

%F a(n) = 4*a(n-1) + 10*a(n-2) + 12*a(n-3).

%F G.f.: x*(1 + 5*x + 9*x^2)/((1 - 6*x)*(1 + 2*x + 2*x^2)).

%F E.g.f.: (1/4)*exp(6*x) + cos(x)/(2*exp(x)) - 3/4.

%F Limit_{n->oo} a(n)/6^n = 1/4.

%e For n=2, (x + x^2 + x^3 + x^4 + x^5 + x^6)^2 = x^2 + 2*x^3 + 3*x^4 + 4*x^5 + 5*x^6 + 6*x^7 + 5*x^8 + 4*x^9 + 3*x^10 + 2*x^11 + x^12. So a(2) = 3 + 5 + 1 = 9.

%t LinearRecurrence[{4, 10, 12}, {1, 9, 55}, 30] (* _Paolo Xausa_, Aug 30 2024 *)

%o (MATLAB) an=(6^n+(-1+1i)^n+(-1-1i)^n)/4

%o (PARI) a(n)=polcoef(lift(Mod(x+x^2+x^3+x^4+x^5+x^6, 1-x^4)^n), 0) \\ _Andrew Howroyd_, Apr 17 2023

%Y Cf. A000400, A009116.

%K easy,nonn

%O 1,2

%A _Yui Chit Chan_, Apr 17 2023