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.

Showing 1-6 of 6 results.

A005990 a(n) = (n-1)*(n+1)!/6.

Original entry on oeis.org

0, 1, 8, 60, 480, 4200, 40320, 423360, 4838400, 59875200, 798336000, 11416204800, 174356582400, 2833294464000, 48819843072000, 889218570240000, 17072996548608000, 344661117825024000, 7298706024529920000, 161787983543746560000
Offset: 1

Views

Author

Keywords

Comments

Coefficients of Gandhi polynomials.
a(n) = Sum_{pi in Symm(n)} Sum_{i=1..n} max(pi(i)-i,0), i.e., the total positive displacement of all letters in all permutations on n letters. - Franklin T. Adams-Watters, Oct 25 2006
a(n) is also the sum of the excedances of all permutations of [n]. An excedance of a permutation p of [n] is an i (1 <= i <= n-1) such that p(i) > i. Proof: i is an excedance if p(i) = i+1, i+2, ..., n (n-i possibilities), with the remaining values of p forming any permutation of [n]\{p(i)} in the positions [n]\{i} ((n-1)! possibilities). Summation of i(n-i)(n-1)! over i from 1 to n-1 completes the proof. Example: a(3)=8 because the permutations 123, 132, 213, 231, 312, 321 have excedances NONE, {2}, {1}, {1,2}, {1}, {1}, respectively. - Emeric Deutsch, Oct 26 2008
a(n) is also the number of doubledescents in all permutations of {1,2,...,n-1}. We say that i is a doubledescent of a permutation p if p(i) > p(i+1) > p(i+2). Example: a(3)=8 because each of the permutations 1432, 4312, 4213, 2431, 3214, 3421 has one doubledescent, the permutation 4321 has two doubledescents and the remaining 17 permutations of {1,2,3,4} have no doubledescents. - Emeric Deutsch, Jul 26 2009
Equals the second right hand column of A167568 divided by 2. - Johannes W. Meijer, Nov 12 2009
Half of sum of abs(p(i+1) - p(i)) over all permutations on n, e.g., 42531 = 2 + 3 + 2 + 2 = 9, and the total over all permutations on {1,2,3,4,5} is 960. - Jon Perry, May 24 2013
a(n) gives the number of non-occupied corners in tree-like tableaux of size n+1 (see Gao et al. link). - Michel Marcus, Nov 18 2015
a(n) is the number of sequences of n+2 balls colored with at most n colors such that exactly three balls are the same color as some other ball in the sequence. - Jeremy Dover, Sep 26 2017
a(n) is the number of triangles (3-cycles) in the (n+1)-alternating group graph. - Eric W. Weisstein, Jun 09 2019

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    [(n-1)*Factorial(n+1)/6: n in [1..25]]; // Vincenzo Librandi, Oct 11 2011
    
  • Maple
    [ seq((n-1)*(n+1)!/6,n=1..40) ];
    a:=n->sum(sum(sum(n!/6, j=1..n),k=-1..n),m=0..n): seq(a(n), n=0..19); # Zerinvary Lajos, May 11 2007
    seq(sum(mul(j,j=3..n), k=3..n)/3, n=2..21); # Zerinvary Lajos, Jun 01 2007
    restart: G(x):=x^3/(1-x)^2: f[0]:=G(x): for n from 1 to 21 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n]/3!,n=2..21); # Zerinvary Lajos, Apr 01 2009
  • Mathematica
    Table[Sum[n!/6, {i, 3, n}], {n, 2, 21}] (* Zerinvary Lajos, Jul 12 2009 *)
    Table[(n - 1) (n + 1)!/6, {n, 20}] (* Harvey P. Dale, Apr 07 2019 *)
    Table[(n - 1) Pochhammer[4, n - 2], {n, 20}] (* Eric W. Weisstein, Jun 09 2019 *)
    Table[(n - 1) Gamma[n + 2]/6, {n, 20}] (* Eric W. Weisstein, Jun 09 2019 *)
    Range[0, 20]! CoefficientList[Series[x/(1 - x)^4, {x, 0, 20}], x] (* Eric W. Weisstein, Jun 09 2019 *)
  • PARI
    a(n)=(n-1)*(n+1)!/6 \\ Charles R Greathouse IV, May 24 2013

Formula

a(n) = A090672(n)/2.
a(n) = A052571(n+2)/6. - Zerinvary Lajos, May 11 2007
a(n) = Sum_{m=0..n} Sum_{k=-1..n} Sum_{j=1..n} n!/6, n >= 0. - Zerinvary Lajos, May 11 2007
If we define f(n,i,x) = Sum_{k=i..n} (Sum_{j=i..k} binomial(k,j)*Stirling1(n,k)*Stirling2(j,i)*x^(k-j)) then a(n+1) = (-1)^(n-1)*f(n,1,-4), (n >= 1). - Milan Janjic, Mar 01 2009
E.g.f.: (-1+3*x)/(3!*(1-x)^3), a(0) = -1/3!. Such e.g.f. computations resulted from e-mail exchange with Gary Detlefs. - Wolfdieter Lang, May 27 2010
a(n) = ((n+3)!/2) * Sum_{j=i..k} (k+1)!/(k+3)!, with offset 0. - Gary Detlefs, Aug 05 2010
a(n) = (n+2)!*Sum_{k=1..n-1} 1/((2*k+4)*(k+3)). - Gary Detlefs, Oct 09 2011
a(n) = (n+2)!*(1 + 3*(H(n+1) - H(n+2)))/6, where H(n) is the n-th harmonic number. - Gary Detlefs, Oct 09 2011
With offset = 0, e.g.f.: x/(1-x)^4. - Geoffrey Critzer, Aug 30 2013
From Amiram Eldar, May 06 2022: (Start)
Sum_{n>=2} 1/a(n) = 3*(Ei(1) - gamma) - 6*e + 27/2, where Ei(1) = A091725, gamma = A001620, and e = A001113.
Sum_{n>=2} (-1)^n/a(n) = 3*(gamma - Ei(-1)) - 3/2, where Ei(-1) = -A099285. (End)

Extensions

Better definition from Robert Newstedt

A008303 Triangle read by rows: T(n,k) (n >= 1, 0 <= k <= ceiling(n/2)-1) = number of permutations of [n] with k peaks.

Original entry on oeis.org

1, 2, 4, 2, 8, 16, 16, 88, 16, 32, 416, 272, 64, 1824, 2880, 272, 128, 7680, 24576, 7936, 256, 31616, 185856, 137216, 7936, 512, 128512, 1304832, 1841152, 353792, 1024, 518656, 8728576, 21253376, 9061376, 353792, 2048, 2084864, 56520704, 222398464, 175627264, 22368256
Offset: 1

Views

Author

Keywords

Comments

From Petros Hadjicostas, Aug 06 2019: (Start)
André (1895) first defined these numbers. In his notation, T(n, k) = Q(n+1, 2*(k+1)) for n >= 1 and 0 <= k <= ceiling(n/2)-1.
His triangle is as follows (p. 148):
Q_{2,2}
Q_{3,2}
Q_{4,2} Q_{4,4}
Q_{5,2} Q_{5,4}
Q_{6,2} Q_{6,4} Q_{6,6}
Q_{7,2} Q_{7,4} Q_{7,6}
...
He has Q(n, s) = 0 when either s is odd, or n <= 1, or s > n. Also, Q_{n,2} = 2^(n-2) for n >= 2.
His recurrence is Q(n, s) = s * Q(n-1, s) + (n - s + 1) * Q(n-1, s-2) for n >= 3 and s >= 2. (Obviously, for s odd, we get Q(n, s) = 0 + 0 = 0.)
In terms of the current array, André's (1895) recurrence becomes T(n, k) = (2*k + 2) * T(n-1, k) + (n - 2*k) * T(n-1, k-1) for n >= 2 and 1 <= k <= n with T(n, 0) = 2^(n-1) for n >= 1. In this recurrence, we assume T(n, k) = 0 for k >= ceiling(n/2) or k < 0. (End)
From Petros Hadjicostas, Aug 07 2019: (Start)
We clarify further the quantity Q(n, s) defined by André (1895). In his paper, André considers circular permutations of [n] and deals with maxima, minima, and so-called "séquences" in a permutation.
The term "séquence" in a permutation, as used by André in several of his papers in the 19th century, means a list of consecutive numbers in the permutation that go from a maximum to a minimum, or vice versa, and do not contain any interior minima or maxima. This terminology is also repeated in Ex. 13 (pp. 260-261) by Comtet (even though he refers to the corresponding indices rather than the numbers in the permutation itself).
Some authors call these so-called "séquences" (defined by André and Comtet) "alternate runs" (or just "runs"). Here we are actually dealing with "circular runs" if we read these so-called "séquences" in ascending order in one of the two directions on a circle.
Q(n, s) is the number of circular permutations of [n] (out of the (n-1)! in total) that have exactly s of these so-called "séquences" ("alternate runs").
André (1895) proves that, in a circular permutation of [n], the number of maxima equals the number of minima and that the number of his so-called "séquences" ("alternate runs") is always even (i.e., Q(n, s) = 0 for s odd).
He also shows that, if v = floor(n/2), then the only possible values for the length of a so-called "séquence" ("alternate run") in a circular permutation of [n] are 2, 4, ..., 2*v. That is why Q(n, s) = 0 when either s is odd, or n <= 1, or s > n.
Note that Sum_{t = 1..floor(n/2)} Q_{n, 2*t} = Sum_{t = 1..floor(n/2)} T(n-1, t-1) = (n-1)! = total number of circular permutations of [n].
Since T(n, k) = Q(n+1, 2*(k+1)) for n >= 1 and 0 <= k <= ceiling(n/2)-1, we conclude that the number of (linear) permutations of [n] with k peaks equals the number of circular permutations of [n+1] with exactly 2*(k+1) of these so-called "séquences" ("alternate runs"). (End)
From Petros Hadjicostas, Aug 08 2019: (Start)
The author of this array indirectly assumes that a "peak" of a (linear) permutation of [n] is an interior maximum of the permutation; i.e., we ignore maxima at the endpoints of a permutation.
Similarly, a "valley" of a (linear) permutation of [n] is an interior minimum of the permutation; i.e., we ignore minima at the endpoints of the permutation.
Since the complement of a permutation a_1 a_2 ... a_n (using one-line notation, not cycle notation) is (n+1-a_1) (n+1-a_2) ... (n+1-a_n), it follows that, for n >= 2 and 0 <= k <= ceiling(n/2) - 1, T(n, k) is also the number of (linear) permutations of [n] with exactly k valleys. (End)

Examples

			Triangle T(n,k) (with rows n >= 1 and columns k >= 0) starts as follows:
  [ 1]    1;
  [ 2]    2;
  [ 3]    4,       2;
  [ 4]    8,      16;
  [ 5]   16,      88,      16;
  [ 6]   32,     416,     272;
  [ 7]   64,    1824,    2880,     272;
  [ 8]  128,    7680,   24576,    7936;
  [ 9]  256,   31616,  185856,  137216,    7936;
  [10]  512,  128512, 1304832, 1841152,  353792;
    A000079, A000431, A000487, A000517, A179708, ...
T(3,1) = 2 because we have 132 and 231.
From _Petros Hadjicostas_, Aug 07 2019: (Start)
In terms of André's (1895) notation (see the comments above), we have Q(4, 2) = T(3, 0) = 4 and Q(4, 4) = T(3, 1) = 2.
Out of the (4-1)! = 6 circular permutations of [4], each of the permutations 1324 and 1423 has exactly 4 so-called "séquences" ("alternate runs"), while each of the rest (1234, 1243, 1342, and 1432) has exactly 2 so-called "séquences" ("alternate runs").
In detail, we list the so-called "séquences" ("alternate runs") of the above circular permutations:
  1234 --> 1234 and 41 (maximum 4 and minimum 1).
  1243 --> 124 and 431 (maximum 4 and minimum 1).
  1324 --> 13, 32, 24, and 41 (maxima 3, 4, and minima 1, 2).
  1342 --> 134 and 421 (maximum 4 and minimum 1).
  1423 --> 14, 42, 23, and 31 (maxima 3, 4 and minima 1, 2),
  1432 --> 14 and 4321 (maximum 4 and minimum 1).
(End)
		

References

  • Florence Nightingale David and D. E. Barton, Combinatorial Chance, Charles Griffin, 1962; see Table 10.6, p. 163. [They use the notation T_{N,t^*}^{**}, where N is the length of the permutation and t^* is the number of peaks in the permutation. They also give André's recurrence. So, here n = N and k = t^*. - Petros Hadjicostas, Aug 09 2019]
  • Florence Nightingale David, Maurice George Kendall, and D. E. Barton, Symmetric Functions and Allied Tables, Cambridge, 1966, p. 261, Table 7.3.
  • I. P. Goulden and D. M. Jackson, Combinatorial Enumeration, John Wiley and Sons, N.Y., 1983, Ex. 3.3.46. - Emeric Deutsch, Jul 26 2009
  • T. K. Petersen, Eulerian Numbers, Birkhäuser, 2015, Chapter 4.

Crossrefs

From Emeric Deutsch, Jul 26 2009: (Start)
Sum of entries in row n is n! = A000142(n).
T(n,0) = 2^(n-1) = A000079(n-1).
T(n,1) = A000431(n).
T(n,2) = A000487(n).
T(n,3) = A000517(n).
T(2n, n-1) = T(2n+1, n) = A000182(n+1) (the tangent numbers). (End)
Columns k = 0-6 give: A011782, A000431, A000487, A000517, A179708, A179709, A179710.

Programs

  • Maple
    # The Maple program yields (by straightforward counting) the generating polynomial of the row n specified in the program.
    n := 8: with(combinat): P := permute(n): st := proc (p) local ct, j: ct := 0: for j from 2 to nops(p)-1 do if p[j-1] < p[j] and p[j+1] < p[j] then ct := ct+1 else end if end do: ct end proc: sort(add(t^st(P[j]), j = 1 .. factorial(n))); # Emeric Deutsch, Jul 26 2009
    # Second Maple program:
    a := 1+sqrt(1-t): b := 1-sqrt(1-t): G := (exp(b*z)-exp(a*z))/(b*exp(a*z)-a*exp(b*z)): Gser := simplify(series(G, z = 0, 15)): for n to 12 do P[n] := sort(expand(factorial(n)*coeff(Gser, z, n))) end do: for n to 12 do seq(coeff(P[n], t, j), j = 0 .. ceil((1/2)*n)-1) end do; # yields sequence in triangular form - Emeric Deutsch, Jul 26 2009
    # Third Maple program:
    b:= proc(u, o, t) option remember; expand(`if`(u+o=0, 1,
          add(b(u-j, o+j-1, 0)*x^t, j=1..u)+
          add(b(u+j-1, o-j, 1), j=1..o)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)):
    seq(T(n), n=1..15);  # Alois P. Heinz, May 22 2014
    # Recurrence of D. André (1895).
    T := proc(n, k) option remember;
    if n < 1 or 2*k > (n-1) then return 0 fi;
    if k = 0 then return 2^(n-1) fi;
    (2*k + 2)*T(n-1, k) + (n - 2*k)*T(n-1, k-1) end:
    seq(seq(T(n, k), k=0..(n-1)/2), n=1..12); # Peter Luschny, Aug 06 2019
  • Mathematica
    From Luc Roy, Jul 08 2010: (Start)
    It appears that one-half of the sequence A008303 can be obtained with this Mathematica program:
    Expand[CoefficientList[Simplify[InverseSeries[Integrate[
    Series[(1 + m Sinh[x]^2)^(-1), {x, 0, 15}, {m, 0, 15}], x]]], x]
    Denominator[CoefficientList[Series[Exp[x], {x, 0, 15}], x]]]
    (* Mathematica Output of Luc Roy's program *)
    {0, 1, 0, 2 m, 0, 8 m + 16 m^2, 0, 32 m + 416 m^2 + 272 m^3, 0, 128 m + 7680 m^2 + 24576 m^3 + 7936 m^4, 0, 512 m + 128512 m^2 + 1304832 m^3 + 1841152 m^4 + 353792 m^5, 0, 2048 m + 2084864 m^2 + 56520704 m^3 + 222398464 m^4 + 175627264 m^5 + 22368256 m^6, 0, 8192 m + 33497088 m^2 + 2230947840 m^3 + 20261765120 m^4 + 41731645440 m^5 + 21016670208 m^6 + 1903757312 m^7}
    (End)
    (* Another Mathematica program *)
    m = 14; a = 1 + Sqrt[1 - t]; b = 1 - Sqrt[1 - t];
    g[z_] = (E^(b*z) - E^(a*z))/(b*E^(a*z) - a*E^(b*z));
    gser = Series[g[z], {z, 0, m}];
    Do[p[n]=n!*Coefficient[gser, z, n]//Simplify, {n, 0, m}];
    Flatten[ Table[ Coefficient[p[n], t, j], {n, 0, m}, {j, 0, Ceiling[n/2] - 1}]]
    (* Jean-François Alcover, May 27 2011, after Emeric Deutsch *)
    (* To get the triangle from Jean-François Alcover's Mathematica program *)
    FormTable[Table[Coefficient[p[n], t, j], {n, 0, m}, {j, 0, Ceiling[n/2] - 1}]]
    (* Petros Hadjicostas, Aug 06 2019 *)
    gf := Sqrt[x - 1] Cot[y Sqrt[x - 1]] - 1; ser := Series[1/gf, {y, 0, 16}];
    cy[n_] := n! Coefficient[ser, y, n]; row[n_] := CoefficientList[cy[n], x];
    Table[row[n], {n, 1, 12}] // Flatten (* Peter Luschny, Aug 06 2019 *)
  • PARI
    {T(n, k) = if(n<1, 0, my(z = sqrt(1 - y + y*O(y^(n\2)))); n!*polcoef(polcoef(z/(z - tanh(x*z)), n, x), k))}; /* Michael Somos, May 24 2023 */

Formula

From Emeric Deutsch, Jul 26 2009: (Start)
E.g.f.: G(t,z)=[exp(bz)-exp(az)]/[b*exp(az)-a*exp(bz)], where a+b=2 and ab=t, i.e., a=1+sqrt(1-t), b=1-sqrt(1-t) (see the Goulden-Jackson reference). -
Sum_{k>=0} k*T(n,k) = n!*(n-2)/3 = A090672(n-1).
Row n has ceiling(n/2) terms. (End)
E.g.f.: tan(t*sqrt(x-1))/(sqrt(x-1)-tan(t*sqrt(x-1))) = Sum_{n>=0} P(n,x)*t^n/n! = t + 2*t^2/2! + (4+2*x)*t^3/3! + (8+16*x)*t^4/4! + .... The row generating polynomials P(n,x) satisfy x^(n-1)*P(n,1+1/x^2) = R(n-1,x), where R(n,x) are the row polynomials of A185896. A000670(n) = (3/2)^(n-1)*P(n,8/9). - Peter Bala, Oct 14 2011
From Jinyuan Wang, Dec 28 2020: (Start)
T(n, k) = (n - 2*k + 2)*T(n-1, k-1) + 2*k*T(n-1, k) for n > 1 and k > 1; T(n, 1) = 2^(n - 1); T(1, k) = 0 for k > 1.
T(2*k-1, k) = A000182(k). (End)
From Ammar Khatab, Aug 17 2024: (Start)
T(2*n,k) = 4^(n-k+1)* Sum_{p=0..k} (-1)^p * (2*p+2*n-2*k-1)/(p+2*n-2*k-1) binomial(p+2*n-2*k-1,p) (A008292(2*n,k-p+1)+A008292(2*n,2*n+p-k) ) for n>0.
T(2*n+1,k) = 4^(n-k)* Sum_{p=0..k} (-1)^p * (p+n-k)/(p+2*n-2*k) binomial(p+2*n-2*k,p) (A008292(2*n+1,k-p+1)+A008292(2*n,2*n+p-k+1) ) for k<>n. (End)

Extensions

Additional comments from Emeric Deutsch, May 08 2004
More terms from R. J. Mathar and Vladeta Jovovic, Jun 26 2007
Corrected by Emeric Deutsch, Jul 26 2009
Edited definition - N. J. A. Sloane, May 25 2023

A052571 E.g.f. x^3/(1-x)^2.

Original entry on oeis.org

0, 0, 0, 6, 48, 360, 2880, 25200, 241920, 2540160, 29030400, 359251200, 4790016000, 68497228800, 1046139494400, 16999766784000, 292919058432000, 5335311421440000, 102437979291648000, 2067966706950144000
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

For n >= 3, a(n) = number whose factorial base representation (A007623) begins with digit {n-2} followed by n-1 zeros. Viewed in that base, this sequence looks like this: 0, 0, 0, 100, 2000, 30000, 400000, 5000000, 60000000, 700000000, 8000000000, 90000000000, A00000000000, B000000000000, ... (where "digits" A and B stand for placeholder values 10 and 11 respectively). - Antti Karttunen, May 07 2015

Crossrefs

Column 5 of A257503 (apart from zero terms. Equally, row 5 of A257505).
Cf. sequences with formula (n + k)*n! listed in A282466.

Programs

  • Magma
    [0,0] cat [n*(n+1)*(n+2)*Factorial(n): n in [0..20]]; // Vincenzo Librandi, Oct 11 2011
    
  • Maple
    spec := [S,{S=Prod(Z,Z,Z,Sequence(Z),Sequence(Z))},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
    [seq (n*(n+1)*(n+2)*n!,n=0..17)]; # Zerinvary Lajos, Nov 25 2006
    a:=n->add((n!),j=1..n-2):seq(a(n), n=0..21); # Zerinvary Lajos, Aug 27 2008
    G(x):=x^3/(1-x)^2: f[0]:=G(x): for n from 1 to 21 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..19); # Zerinvary Lajos, Apr 01 2009
  • Mathematica
    Table[Sum[n!, {i, 3, n}], {n, 0, 19}] (* Zerinvary Lajos, Jul 12 2009 *)
    With[{nn=20},CoefficientList[Series[x^3/(1-x)^2,{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Feb 27 2025 *)
  • Scheme
    (define (A052571 n) (if (< n 2) 0 (* (- n 2) (A000142 n)))) ;; Antti Karttunen, May 07 2015

Formula

E.g.f.: x^3/(-1+x)^2.
Recurrence: {a(1)=0, a(0)=0, a(2)=0, a(3)=6, (1-n^2)*a(n)+(-2+n)*a(n+1)=0}.
For n >= 2, a(n) = (n-2)*n!.
a(n+2) = n*(n+1)*(n+2)*n!. - Zerinvary Lajos, Nov 25 2006
a(n) = 3*A090672(n-2) = 6*A005990(n-2). - Zerinvary Lajos, May 11 2007
From Amiram Eldar, Jan 14 2021: (Start)
Sum_{n>=3} 1/a(n) = 9/4 - e - gamma/2 + Ei(1)/2 = 9/4 - A001113 - (1/2)*A001620 + (1/2)*A091725.
Sum_{n>=3} (-1)^(n+1)/a(n) = -1/4 + gamma/2 - Ei(-1)/2 = -1/4 + (1/2)*A001620 + (1/2)*A099285. (End)

A138770 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} such that there are exactly k entries between the entries 1 and 2 (n>=2, 0<=k<=n-2).

Original entry on oeis.org

2, 4, 2, 12, 8, 4, 48, 36, 24, 12, 240, 192, 144, 96, 48, 1440, 1200, 960, 720, 480, 240, 10080, 8640, 7200, 5760, 4320, 2880, 1440, 80640, 70560, 60480, 50400, 40320, 30240, 20160, 10080, 725760, 645120, 564480, 483840, 403200, 322560, 241920, 161280, 80640
Offset: 2

Views

Author

Emeric Deutsch, Apr 06 2008

Keywords

Comments

Sum of row n = n! = A000142(n).
The expected value of k is (n-2)/3. [Geoffrey Critzer, Dec 19 2009]

Examples

			T(4,2)=4 because we have 1342, 1432, 2341 and 2431.
Triangle starts:
  2;
  4,2;
  12,8,4;
  48,36,24,12;
  240,192,144,96,48;
  ...
		

Crossrefs

Programs

  • Maple
    T:=proc(n,k) if n-2 < k then 0 else (2*n-2*k-2)*factorial(n-2) end if end proc; for n from 2 to 10 do seq(T(n, k),k=0..n-2) end do; # yields sequence in triangular form
  • Mathematica
    Table[Table[2 (n - r) (n - 2)!, {r, 1, n - 1}], {n, 1, 10}] // Grid (* Geoffrey Critzer, Dec 19 2009 *)

Formula

T(n,k) = 2*(n-k-1)*(n-2)!.
T(n,0) = 2(n-1)! = A052849(n-1).
T(n,1) = A052582(n-2).
T(n,2) = A052609(n-2).
T(n,3) = 12*A005990(n-3).
T(n,4) = 48*A061206(n-5).
T(n,n-2) = 2(n-2)! (A052849).
Sum_{k=0..n-2} k*T(n,k) = n!*(n-2)/3 = A090672(n-1).

A305730 a(n) is the total displacement of all letters in all permutations of n letters with no fixed points.

Original entry on oeis.org

0, 0, 2, 8, 60, 440, 3710, 34608, 355992, 4004880, 48948570, 646121080, 9163171732, 138974771208, 2244977073430, 38485321258720, 697867158824880, 13346709412525728, 268504389357870642, 5668425997555046760, 125302048367006296940, 2894477317277845459160
Offset: 0

Views

Author

Seiichi Manyama, Jun 22 2018

Keywords

Examples

			n | 1 2 3 4 | the displacement of all letters | a(n)
--+---------+---------------------------------+------
2 | 2 1     | 1 + 1 = 2                       |   2
3 | 2 3 1   | 1 + 1 + 2 = 4                   |   8
  | 3 1 2   | 2 + 1 + 1 = 4                   |
4 | 2 1 4 3 | 1 + 1 + 1 + 1 = 4               |  60
  | 2 3 4 1 | 1 + 1 + 1 + 3 = 6               |
  | 2 4 1 3 | 1 + 2 + 2 + 1 = 6               |
  | 3 1 4 2 | 2 + 1 + 1 + 2 = 6               |
  | 3 4 1 2 | 2 + 2 + 2 + 2 = 8               |
  | 3 4 2 1 | 2 + 2 + 1 + 3 = 8               |
  | 4 1 2 3 | 3 + 1 + 1 + 1 = 6               |
  | 4 3 1 2 | 3 + 1 + 2 + 2 = 8               |
  | 4 3 2 1 | 3 + 1 + 1 + 3 = 8               |
		

Crossrefs

Programs

  • PARI
    {a(n) = n*(n+1)!/3*sum(k=0, n, (-1)^k/k!)}

Formula

a(n) = n * (n+1) * A000166(n)/3 = 2/3 * A065087(n).
a(n) = n * (n+1)!/3 * Sum_{k=0..n} (-1)^k/k!.
a(n) = n * (n+1) * (a(n-1)/(n-1) + (-1)^n/3) for n > 1.
a(n) = 2 * A000313(n+2). - Alois P. Heinz, Jun 22 2018
E.g.f.: exp(-x)*x^2*(3 - 2*x + x^2)/(3*(1 - x)^3). - Ilya Gutkovskiy, Jun 25 2018

A306258 a(n) = floor(n^2/4)*n!.

Original entry on oeis.org

0, 0, 2, 12, 96, 720, 6480, 60480, 645120, 7257600, 90720000, 1197504000, 17244057600, 261534873600, 4271736268800, 73229764608000, 1339058552832000, 25609494822912000, 518592270163968000, 10948059036794880000, 243290200817664000000
Offset: 0

Views

Author

Alaa Sultan Al-hasani, Feb 01 2019

Keywords

Comments

a(n) is the total displacement of all letters in all permutations on n letters as if the first letter were connected to the last letter, forming a loop.
For the sequence A090672 the displacement of the permutation "0123" is 0, while that of the permutation "3210" is 8 because each of the digits 0 and 3 is 3 places away from its original place and each of the digits 1 and 2 is one place away, so the total displacement is 3+1+1+3 = 8.
In this sequence, however, the displacement is calculated differently: that of "0123" is 0 as before, but the displacement of "3210" is no longer 8 because the first index and last index are connected, forming a loop; each of the digits 0 and 3 is now 1 place away from its original place (and each of the digits 1 and 2 is one place away, as before), so the total displacement is calculated as 1+1+1+1 = 4.

Crossrefs

Programs

  • Mathematica
    Table[Floor[n^2/4]n!,{n,0,40}] (* Harvey P. Dale, Jan 16 2023 *)
  • PARI
    a(n) = floor(n^2/4)*n!;

Formula

a(n) = floor(n^2/4)*n!.
a(n) = A002620(n)*n!.
a(n) = A077613(n)*n.
E.g.f.: x^2/((x+1)*(1-x)^3). - Alois P. Heinz, Feb 01 2019
Showing 1-6 of 6 results.