cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A151632 Number of permutations of 3 indistinguishable copies of 1..n with exactly 2 adjacent element pairs in decreasing order.

Original entry on oeis.org

0, 9, 405, 6750, 83736, 922347, 9639783, 98361900, 992660346, 9967494609, 99857394225, 999379243674, 9997315646220, 99988457276295, 999950607877131, 9999789546603672, 99999106646803758, 999996220428781005, 9999984057081398901, 99999932929790707494
Offset: 1

Views

Author

R. H. Hardin, May 29 2009

Keywords

Crossrefs

Column k=2 of A174266.

Programs

  • Mathematica
    T[n_, k_]:= T[n, k]= Sum[(-1)^(k-j)*Binomial[3*n+1, k-j+2]*(Binomial[j+1,3])^n, {j, 0, k+2}];
    Table[T[n, 2], {n, 30}] (* G. C. Greubel, Mar 26 2022 *)
  • PARI
    a(n) = {10^n - (3*n + 1)*4^n + 3*n*(3*n + 1)/2} \\ Andrew Howroyd, May 06 2020
    
  • PARI
    concat(0, Vec(9*x^2*(1 + 24*x - 42*x^2 - 64*x^3) / ((1 - x)^3*(1 - 4*x)^2*(1 - 10*x)) + O(x^40))) \\ Colin Barker, Jul 17 2020
    
  • Sage
    @CachedFunction
    def T(n, k): return sum( (-1)^(k-j)*binomial(3*n+1, k-j+2)*(binomial(j+1,3))^n for j in (0..k+2) )
    [T(n, 2) for n in (1..30)] # G. C. Greubel, Mar 26 2022

Formula

a(n) = 10^n - (3*n + 1)*4^n + 3*n*(3*n + 1)/2. - Andrew Howroyd, May 06 2020
From Colin Barker, Jul 17 2020: (Start)
G.f.: 9*x^2*(1 + 24*x - 42*x^2 - 64*x^3) / ((1 - x)^3*(1 - 4*x)^2*(1 - 10*x)).
a(n) = 21*a(n-1) - 153*a(n-2) + 503*a(n-3) - 786*a(n-4) + 576*a(n-5) - 160*a(n-6) for n>6.
(End)

Extensions

Terms a(10) and beyond from Andrew Howroyd, May 06 2020