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”).

A362365
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
1, 9, 55, 322, 1946, 11664, 69980, 419912, 2519416, 15116544, 90699280, 544195552, 3265173536, 19591041024, 117546246080, 705277476992, 4231664861056, 25389989167104, 152339935002880, 914039610015232, 5484237660094976, 32905425960566784, 197432555763399680
OFFSET
1,2
COMMENTS
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.
FORMULA
a(n) = (1/4)*6^n + (2^(n/2-1))*cos(3*Pi*n/4).
a(n) = (1/4)*(6^n + (-1+i)^n + (-1-i)^n), where i is the imaginary unit.
a(n) = (1/4)*(A000400(n) + 2*A009116(n)).
a(n) = 4*a(n-1) + 10*a(n-2) + 12*a(n-3).
G.f.: x*(1 + 5*x + 9*x^2)/((1 - 6*x)*(1 + 2*x + 2*x^2)).
E.g.f.: (1/4)*exp(6*x) + cos(x)/(2*exp(x)) - 3/4.
Limit_{n->oo} a(n)/6^n = 1/4.
EXAMPLE
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.
MATHEMATICA
LinearRecurrence[{4, 10, 12}, {1, 9, 55}, 30] (* Paolo Xausa, Aug 30 2024 *)
PROG
(MATLAB) an=(6^n+(-1+1i)^n+(-1-1i)^n)/4
(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
CROSSREFS
Sequence in context: A244650 A097790 A356339 * A183805 A037578 A096191
KEYWORD
easy,nonn
AUTHOR
Yui Chit Chan, Apr 17 2023
STATUS
approved