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-7 of 7 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

A257503 Square array A(row,col) read by antidiagonals: A(1,col) = A256450(col-1), and for row > 1, A(row,col) = A255411(A(row-1,col)); Dispersion of factorial base shift A255411 (array transposed).

Original entry on oeis.org

1, 2, 4, 3, 12, 18, 5, 16, 72, 96, 6, 22, 90, 480, 600, 7, 48, 114, 576, 3600, 4320, 8, 52, 360, 696, 4200, 30240, 35280, 9, 60, 378, 2880, 4920, 34560, 282240, 322560, 10, 64, 432, 2976, 25200, 39600, 317520, 2903040, 3265920, 11, 66, 450, 3360, 25800, 241920, 357840, 3225600, 32659200, 36288000, 13, 70, 456, 3456, 28800, 246240, 2540160, 3588480, 35925120, 399168000, 439084800
Offset: 1

Views

Author

Antti Karttunen, Apr 27 2015

Keywords

Comments

The array is read by antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
The first row (A256450) contains all the numbers which have at least one 1-digit in their factorial base representation (see A007623), after which the successive rows are obtained from the terms on the row immediately above by shifting their factorial representation one left and then incrementing the nonzero digits in that representation with a factorial base shift-operation A255411.

Examples

			The top left corner of the array:
     1,     2,     3,     5,      6,      7,      8,      9,     10,     11,     13
     4,    12,    16,    22,     48,     52,     60,     64,     66,     70,     76
    18,    72,    90,   114,    360,    378,    432,    450,    456,    474,    498
    96,   480,   576,   696,   2880,   2976,   3360,   3456,   3480,   3576,   3696
   600,  3600,  4200,  4920,  25200,  25800,  28800,  29400,  29520,  30120,  30840
  4320, 30240, 34560, 39600, 241920, 246240, 272160, 276480, 277200, 281520, 286560
  ...
		

Crossrefs

Transpose: A257505.
Inverse permutation: A257504.
Row index: A257679, Column index: A257681.
Row 1: A256450, Row 2: A257692, Row 3: A257693.
Columns 1-3: A001563, A062119, A130744 (without their initial zero-terms).
Column 4: A213167 (without the initial one).
Column 5: A052571 (without initial zeros).
Cf. also permutations A255565 and A255566.
Thematically similar arrays: A083412, A135764, A246278.

Programs

Formula

A(1,col) = A256450(col-1), and for row > 1, A(row,col) = A255411(A(row-1,col)).

Extensions

Formula changed because of the changed starting offset of A256450 - Antti Karttunen, May 30 2016

A257505 Square array A(row,col): A(row,1) = A256450(row-1), and for col > 1, A(row,col) = A255411(A(row,col-1)); Dispersion of factorial base shift A255411.

Original entry on oeis.org

1, 4, 2, 18, 12, 3, 96, 72, 16, 5, 600, 480, 90, 22, 6, 4320, 3600, 576, 114, 48, 7, 35280, 30240, 4200, 696, 360, 52, 8, 322560, 282240, 34560, 4920, 2880, 378, 60, 9, 3265920, 2903040, 317520, 39600, 25200, 2976, 432, 64, 10, 36288000, 32659200, 3225600, 357840, 241920, 25800, 3360, 450, 66, 11, 439084800, 399168000, 35925120, 3588480, 2540160, 246240, 28800, 3456, 456, 70, 13
Offset: 1

Views

Author

Antti Karttunen, Apr 27 2015

Keywords

Comments

The array is read by downward antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
In Kimberling's terminology, this array is called the dispersion of sequence A255411 (when started from its first nonzero term, 4). The left column is the complement of that sequence, which is A256450.

Examples

			The top left corner of the array:
   1,   4,  18,   96,   600,   4320,   35280,   322560,   3265920
   2,  12,  72,  480,  3600,  30240,  282240,  2903040,  32659200
   3,  16,  90,  576,  4200,  34560,  317520,  3225600,  35925120
   5,  22, 114,  696,  4920,  39600,  357840,  3588480,  39553920
   6,  48, 360, 2880, 25200, 241920, 2540160, 29030400, 359251200
   7,  52, 378, 2976, 25800, 246240, 2575440, 29352960, 362517120
   8,  60, 432, 3360, 28800, 272160, 2822400, 31933440, 391910400
   9,  64, 450, 3456, 29400, 276480, 2857680, 32256000, 395176320
  10,  66, 456, 3480, 29520, 277200, 2862720, 32296320, 395539200
  11,  70, 474, 3576, 30120, 281520, 2898000, 32618880, 398805120
  13,  76, 498, 3696, 30840, 286560, 2938320, 32981760, 402433920
  14,  84, 552, 4080, 33840, 312480, 3185280, 35562240, 431827200
  15,  88, 570, 4176, 34440, 316800, 3220560, 35884800, 435093120
  17,  94, 594, 4296, 35160, 321840, 3260880, 36247680, 438721920
  19, 100, 618, 4416, 35880, 326880, 3301200, 36610560, 442350720
  20, 108, 672, 4800, 38880, 352800, 3548160, 39191040, 471744000
  21, 112, 690, 4896, 39480, 357120, 3583440, 39513600, 475009920
  23, 118, 714, 5016, 40200, 362160, 3623760, 39876480, 478638720
  ...
		

Crossrefs

Transpose: A257503.
Inverse permutation: A257506.
Row index: A257681, Column index: A257679.
Columns 1-3: A256450, A257692, A257693.
Rows 1-3: A001563, A062119, A130744 (without their initial zero-terms).
Row 4: A213167 (without the initial one).
Row 5: A052571 (without initial zeros).
Cf. also permutations A255565, A255566.
Thematically similar arrays: A035513, A054582, A246279.

Programs

Formula

A(row,1) = A256450(row-1), and for col > 1, A(row,col) = A255411(A(row,col-1)).

Extensions

Formula changed because of the changed starting offset of A256450 - Antti Karttunen, May 30 2016

A282466 a(n) = n*a(n-1) + n!, with n>0, a(0)=5.

Original entry on oeis.org

5, 6, 14, 48, 216, 1200, 7920, 60480, 524160, 5080320, 54432000, 638668800, 8143027200, 112086374400, 1656387532800, 26153487360000, 439378587648000, 7825123418112000, 147254595231744000, 2919482409811968000, 60822550204416000000, 1328364496464445440000
Offset: 0

Views

Author

Bruno Berselli, Feb 22 2017

Keywords

References

  • C. Mariconda and A. Tonolo, Calcolo discreto, Apogeo (2012), page 240 (Example 9.57 gives the recurrence).

Crossrefs

Cf. A229039.
Cf. sequences with formula (n + k)*n!: A052521 (k=-5), A282822 (k=-4), A052520 (k=-3), A052571 (k=-2), A062119 (k=-1), A001563 (k=0), A000142 (k=1), A001048 (k=2), A052572 (k=3), A052644 (k=4), this sequence (k=5).

Programs

  • Magma
    A282466:= func< n | (n+5)*Factorial(n) >; // G. C. Greubel, May 14 2025
    
  • Mathematica
    RecurrenceTable[{a[0] == 5, a[n] == n a[n - 1] + n!}, a, {n, 0, 30}] (* or *)
    Table[(n + 5) n!, {n, 0, 30}]
  • SageMath
    def A282466(n): return (n+5)*factorial(n) # G. C. Greubel, May 14 2025

Formula

E.g.f.: (5 - 4*x)/(1 - x)^2.
a(n) = (n + 5)*n!.
a(n) = 2*A229039(n) for n>0.
From Amiram Eldar, Nov 06 2020: (Start)
Sum_{n>=0} 1/a(n) = 9*e - 24.
Sum_{n>=0} (-1)^n/a(n) = 24 - 65/e. (End)

A090672 a(n) = (n^2-1)*n!/3.

Original entry on oeis.org

0, 2, 16, 120, 960, 8400, 80640, 846720, 9676800, 119750400, 1596672000, 22832409600, 348713164800, 5666588928000, 97639686144000, 1778437140480000, 34145993097216000, 689322235650048000, 14597412049059840000, 323575967087493120000, 7493338185184051200000
Offset: 1

Views

Author

N. J. A. Sloane, Dec 18 2003

Keywords

Comments

a(n) = Sum_{pi in Symm(n)} Sum_{i=1..n} |pi(i)-i|, i.e., the total displacement of all letters in all permutations on n letters.
a(n) = number of entries between the entries 1 and 2 in all permutations of {1,2,...,n+1}. Example: a(2)=2 because we have 123, 1(3)2, 213, 2(3)1, 312, 321; the entries between 1 and 2 are surrounded by parentheses. - Emeric Deutsch, Apr 06 2008
a(n) = Sum_{k=0..n-1} k*A138770(n+1,k). - Emeric Deutsch, Apr 06 2008
a(n) is also the number of peaks in all permutations of {1,2,...,n+1}. Example: a(3)=16 because the permutations 1234, 4123, 3124, 4312, 2134, 4213, 3214, and 4321 have no peaks and each of the remaining 16 permutations of {1,2,3,4} has exactly one peak. - Emeric Deutsch, Jul 26 2009
a(n), for n>=2, is the number of (n+2)-node tournaments that have exactly one triad. Proven by Kadane (1966), see link. - Ian R Harris, Sep 26 2022

References

  • D. Daly and P. Vojtechovsky, Displacement of permutations, preprint, 2003.

Crossrefs

Programs

  • Magma
    [(n^2-1)*Factorial(n)/3: n in [1..25]]; // Vincenzo Librandi, Oct 11 2011
  • Mathematica
    nn=20;Drop[Range[0,nn]!CoefficientList[Series[ x^3/3/(1-x)^2,{x,0,nn}],x],2]  (* Geoffrey Critzer, Mar 04 2013 *)

Formula

a(n) = A052571(n+2)/3 = 2*A005990(n). - Zerinvary Lajos, May 11 2007
a(n) = (n+3)! * Sum_{k=1..n} (k+1)!/(k+3)!, with offset 0. - Gary Detlefs, Aug 05 2010
E.g.f.: (x^3 - 3*x^2)/(3*(x-1)^3). - Geoffrey Critzer, Mar 04 2013
From Amiram Eldar, May 14 2022: (Start)
Sum_{n>=2} 1/a(n) = (3/2)*(Ei(1) - gamma) - 3*e + 27/4, where Ei(1) = A091725, gamma = A001620, and e = A001113.
Sum_{n>=2} (-1)^n/a(n) = (3/2)*(gamma - Ei(-1)) - 3/4, where Ei(-1) = -A099285. (End)

A324225 Total number T(n,k) of 1's in falling diagonals with index k in all n X n permutation matrices; triangle T(n,k), n>=1, 1-n<=k<=n-1, read by rows.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 6, 4, 2, 6, 12, 18, 24, 18, 12, 6, 24, 48, 72, 96, 120, 96, 72, 48, 24, 120, 240, 360, 480, 600, 720, 600, 480, 360, 240, 120, 720, 1440, 2160, 2880, 3600, 4320, 5040, 4320, 3600, 2880, 2160, 1440, 720, 5040, 10080, 15120, 20160, 25200, 30240, 35280, 40320, 35280, 30240, 25200, 20160, 15120, 10080, 5040
Offset: 1

Views

Author

Alois P. Heinz, Feb 18 2019

Keywords

Comments

T(n,k) is the number of occurrences of k in all (signed) displacement lists [p(i)-i, i=1..n] of permutations p of [n].

Examples

			The 6 permutations p of [3]: 123, 132, 213, 231, 312, 321 have (signed) displacement lists [p(i)-i, i=1..3]: [0,0,0], [0,1,-1], [1,-1,0], [1,1,-2], [2,-1,-1], [2,0,-2], representing the indices of falling diagonals of 1's in the permutation matrices
  [1    ]  [1    ]  [  1  ]  [  1  ]  [    1]  [    1]
  [  1  ]  [    1]  [1    ]  [    1]  [1    ]  [  1  ]
  [    1]  [  1  ]  [    1]  [1    ]  [  1  ]  [1    ] , respectively. Indices -2 and 2 occur twice, -1 and 1 occur four times, and 0 occurs six times. So row n=3 is [2, 4, 6, 4, 2].
Triangle T(n,k) begins:
  :                             1                           ;
  :                        1,   2,   1                      ;
  :                   2,   4,   6,   4,   2                 ;
  :              6,  12,  18,  24,  18,  12,   6            ;
  :        24,  48,  72,  96, 120,  96,  72,  48,  24       ;
  :  120, 240, 360, 480, 600, 720, 600, 480, 360, 240, 120  ;
		

Crossrefs

Columns k=0-6 give (offsets may differ): A000142, A001563, A062119, A052571, A052520, A282822, A052521.
Row sums give A001563.
T(n+1,n) gives A000142.
T(n+1,n-1) gives A052849.
T(n+1,n-2) gives A052560 for n>1.
Cf. A152883 (right half of this triangle without center column), A162608 (left half of this triangle), A306461, A324224.
Cf. A001710.

Programs

  • Maple
    b:= proc(s, c) option remember; (n-> `if`(n=0, c,
          add(b(s minus {i}, c+x^(n-i)), i=s)))(nops(s))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1-n..n-1))(b({$1..n}, 0)):
    seq(T(n), n=1..8);
    # second Maple program:
    egf:= k-> (t-> x^t/t*hypergeom([2, t], [t+1], x))(abs(k)+1):
    T:= (n, k)-> n! * coeff(series(egf(k), x, n+1), x, n):
    seq(seq(T(n, k), k=1-n..n-1), n=1..8);
    # third Maple program:
    T:= (n, k)-> (t-> `if`(t
    				
  • Mathematica
    T[n_, k_] := With[{t = Abs[k]}, If[tJean-François Alcover, Mar 25 2021, after 3rd Maple program *)

Formula

T(n,k) = T(n,-k).
T(n,k) = (n-t)*(n-1)! if t < n with t = |k|, T(n,k) = 0 otherwise.
T(n,k) = |k|! * A324224(n,k).
E.g.f. of column k: x^t/t * hypergeom([2, t], [t+1], x) with t = |k|+1.
|T(n,k)-T(n,k-1)| = (n-1)! for k = 1-n..n.
Sum_{k=0..n-1} T(n,k) = A001710(n+1).

A344901 Triangle read by rows: T(n,k) is the number of permutations of length n that have k same elements at the same positions with its inverse permutation for 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 0, 2, 2, 0, 0, 4, 6, 8, 0, 0, 10, 24, 30, 40, 0, 0, 26, 160, 144, 180, 160, 0, 0, 76, 1140, 1120, 1008, 840, 700, 0, 0, 232, 8988, 9120, 8960, 5376, 4200, 2912, 0, 0, 764, 80864, 80892, 82080, 53760, 30240, 19656, 12768, 0, 0, 2620, 809856, 808640, 808920, 547200, 336000, 157248, 95760, 55680, 0, 0, 9496
Offset: 0

Views

Author

Mikhail Kurkov, Jun 01 2021

Keywords

Examples

			Triangle T(n,k) begins:
     1;
     0,    1;
     0,    0,    2;
     2,    0,    0,    4;
     6,    8,    0,    0,   10;
    24,   30,   40,    0,    0,   26;
   160,  144,  180,  160,    0,    0, 76;
  1140, 1120, 1008,  840,  700,    0,  0, 232;
  8988, 9120, 8960, 5376, 4200, 2912,  0,   0, 764;
  ...
		

Crossrefs

Columns k=0-1 give: A038205, A221145.
Row sums give A000142.
Main diagonal gives A000085.

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, 1, add(b(n-j, t)*
          binomial(n-1, j-1)*(j-1)!, j=`if`(t=1, 1..min(2, n), 3..n)))
        end:
    T:= (n, k)-> binomial(n, k)*b(k, 1)*b(n-k, 0):
    seq(seq(T(n, k), k=0..n), n=0..10);  # Alois P. Heinz, Oct 28 2024
  • Mathematica
    b[n_, t_] := b[n, t] = If[n == 0, 1, Sum[b[n-j, t]* Binomial[n-1, j-1]*(j-1)!, {j, If[t == 1, Range @ Min[2, n], Range[3, n]]}]];
    T[n_, k_] := Binomial[n, k]*b[k, 1]*b[n-k, 0];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* Jean-François Alcover, Apr 24 2025, after Alois P. Heinz *)

Formula

T(n,k) = binomial(n,k)*A000085(k)*A038205(n-k).
From Alois P. Heinz, Oct 28 2024: (Start)
Sum_{k=0..n} k * T(n,k) = A052849(n) = A098558(n) for n>=2.
Sum_{k=0..n} (n-k) * T(n,k) = A052571(n).
Sum_{k=0..n} (-1)^k * T(n,k) = A000023(n).
T(n,0) + T(n,1) = A137482(n). (End)
Showing 1-7 of 7 results.