OFFSET
0,3
COMMENTS
Number of permutation patterns modulo 3. This matches the multinomial formula. - Olivier Gérard, Feb 25 2011
Also the number of permutations of n elements where p(k-3) < p(k) for all k. - Joerg Arndt, Jul 23 2011
Also the number of n-step walks on cubic lattice starting at (0,0,0), ending at (floor(n/3), floor((n+1)/3), floor((n+2)/3)), remaining in the first (nonnegative) octant and using steps (0,0,1), (0,1,0), and (1,0,0). - Alois P. Heinz, Oct 11 2019
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000 (first 101 terms from Vincenzo Librandi)
FORMULA
Recurrence: (n+1)*(n+2)*(3*n+1)*a(n) = 3*(3*n^2 + 3*n + 2)*a(n-1) + 27*(n-1)*(n+2)*a(n-2) + 27*(n-2)*(n-1)*(3*n+4)*a(n-3). - Vaclav Kotesovec, Feb 26 2014
a(n) ~ 3^(n+3/2) / (2*Pi*n). - Vaclav Kotesovec, Feb 26 2014
EXAMPLE
Starting from n=4, several permutations have the same pattern. Both (3,1,4,2) and (3,4,1,2) have pattern (0, 1, 1, 2) modulo 3.
MAPLE
a:= n-> combinat[multinomial](n, floor((n+i)/3)$i=0..2):
seq(a(n), n=0..24); # Alois P. Heinz, Oct 11 2019
MATHEMATICA
Table[ n!/(Quotient[n, 3]!*Quotient[n + 1, 3]!*Quotient[n + 2, 3]!), {n, 0, 30}]
Table[n!/Times@@(Floor/@((n+{0, 1, 2})/3)!), {n, 0, 30}] (* Harvey P. Dale, Jul 13 2012 *)
Table[Multinomial[Floor[n/3], Floor[(n+1)/3], Floor[(n+2)/3]], {n, 0, 30}] (* Jean-François Alcover, Jun 24 2015 *)
PROG
(PARI) a(n)=n!/((n\3)!*((n+1)\3)!*((n+2)\3)!)
(PARI) {a(n)= if(n<0, 0, n!/(n\3)!/((n+1)\3)!/((n+2)\3)!)} /* Michael Somos, Jun 20 2007 */
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
Clark Kimberling, Jun 14 1998
EXTENSIONS
Corrected by Michael Somos, Jun 20 2007
STATUS
approved