login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A193638 Number of permutations of the multiset {1,1,1,2,2,2,3,3,3,...,n,n,n} with no two consecutive terms equal. 2
1, 0, 2, 174, 41304, 19606320, 16438575600, 22278418248240, 45718006789687680, 135143407245840698880, 553269523327347306412800, 3039044104423605600086688000, 21819823367694505460651694873600, 200345011881335747639978525387827200 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Andrew Woods, Table of n, a(n) for n = 0..101

H. Eriksson, A. Martin, Enumeration of Carlitz multipermutations, arXiv:1702.04177 [math.CO], 2017.

FORMULA

a(n) = A190826(n) * n! for n >= 1.

EXAMPLE

a(2) = 2 because there are two permutations of {1,1,1,2,2,2} avoiding equal consecutive terms: 121212 and 212121.

MAPLE

a:= proc(n) option remember; `if`(n<3, (n-1)*(3*n-2)/2,

      n*((3*n-1)*(3*n^2-5*n+4) *a(n-1)

      +2*(n-1)*(6*n^2-9*n-1) *a(n-2)

      -4*n*(n-1)*(n-2) *a(n-3))/(2*n-2))

    end:

seq(a(n), n=0..20);  # Alois P. Heinz, Jun 05 2013

MATHEMATICA

a[n_] := 1/6^n Sum[(n+j)! Sum[Binomial[n, k] Binomial[2k, j] (-3)^(n+k-j), {k, Ceiling[j/2], n}], {j, 0, 2n}];  Table[a[n], {n, 0, 13}] (* Jean-Fran├žois Alcover, Jul 22 2017, after Tani Akinari *)

PROG

(Maxima) a(n):= (1/6^n)*sum((n+j)!*sum(binomial(n, k)*binomial(2*k, j)* (-3)^(n+k-j), k, ceiling(j/2), n), j, 0, 2*n); [Tani Akinari, Sep 23 2012]

(Python)

class Memoize:

    def __init__(self, func):

        self.func=func

        self.cache={}

    def __call__(self, arg):

        if arg not in self.cache:

            self.cache[arg] = self.func(arg)

        return self.cache[arg]

@Memoize

def a(n): return (n - 1)*(3*n - 2)/2 if n<3 else n*((3*n - 1)*(3*n**2 - 5*n + 4)*a(n - 1) + 2*(n - 1)*(6*n**2 - 9*n - 1)*a(n - 2) - 4*n*(n - 1)*(n - 2)*a(n - 3))/(2*n - 2)

print map(a, xrange(51)) # Indranil Ghosh, Jul 22 2017, formula after Maple code

CROSSREFS

Cf. A114938 = similar with two copies instead of three.

Cf. A193624 = arrangements of triplets with no adjacent siblings; A193624(n) = 6^n * a(n).

Sequence in context: A139935 A281958 A172231 * A215123 A219724 A103427

Adjacent sequences:  A193635 A193636 A193637 * A193639 A193640 A193641

KEYWORD

nonn,changed

AUTHOR

Andrew Woods, Aug 01 2011

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified July 27 16:35 EDT 2017. Contains 289866 sequences.