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.

Previous Showing 21-30 of 38 results. Next

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).

A159038 a(n) = 8 * n!.

Original entry on oeis.org

8, 16, 48, 192, 960, 5760, 40320, 322560, 2903040, 29030400, 319334400, 3832012800, 49816166400, 697426329600, 10461394944000, 167382319104000, 2845499424768000, 51218989645824000, 973160803270656000
Offset: 1

Views

Author

Zerinvary Lajos, Apr 03 2009

Keywords

Crossrefs

Programs

Formula

a(n) = 8 * A000142(n) for n > 0.

A256031 Number of irreducible idempotents in partial Brauer monoid PB_n.

Original entry on oeis.org

2, 3, 12, 30, 240, 840, 10080, 45360, 725760, 3991680, 79833600, 518918400, 12454041600, 93405312000, 2615348736000, 22230464256000, 711374856192000, 6758061133824000, 243290200817664000, 2554547108585472000, 102181884343418880000, 1175091669949317120000
Offset: 1

Views

Author

N. J. A. Sloane, Mar 14 2015

Keywords

Comments

Table 2 in chapter 7 of the preprint contains a typo: a(9) is not 725860. - R. J. Mathar, Mar 14 2015

Crossrefs

Programs

  • Maple
    A256031 := proc(n)
        if type(n,'odd') then
            2*n! ;
        else
            (n+1)*(n-1)! ;
        end if;
    end proc:
    seq(A256031(n),n=1..20) ; # R. J. Mathar, Mar 14 2015
  • Mathematica
    a[n_] := If[OddQ[n], 2*n!, (n + 1)*(n - 1)!];
    Array[a, 20] (* Jean-François Alcover, Nov 24 2017, from Maple *)

Formula

There are simple formulas for the two bisections - see Dolinka et al.
a(2n-1) = A052612(2n-1) = A052616(2n-1) = A052849(2n-1) = A098558(2n-1) = A208529(2n+1). - Omar E. Pol, Mar 14 2015
Sum_{n>=1} 1/a(n) = (e^2+3)/(4*e) = 1/e + sinh(1)/2. - Amiram Eldar, Feb 02 2023

A298881 a(0) = 0; for n>0, a(n) = 6*n!.

Original entry on oeis.org

0, 6, 12, 36, 144, 720, 4320, 30240, 241920, 2177280, 21772800, 239500800, 2874009600, 37362124800, 523069747200, 7846046208000, 125536739328000, 2134124568576000, 38414242234368000, 729870602452992000, 14597412049059840000, 306545653030256640000
Offset: 0

Views

Author

Vincenzo Librandi, Feb 13 2018

Keywords

Crossrefs

Cf. A274266.
Cf. sequences of the type k*n!: A000142 (k=1), A052849 (k=2), A052560 (k=3), A052578 (k=4), A052648 (k=5), this sequence (k=6), A062098 (k=7), A159038 (k=8), A174183 (k=10).

Programs

  • GAP
    Concatenation([0], List([1..25], n -> 6*Factorial(n))); # Bruno Berselli, Feb 13 2018
    
  • Magma
    [n eq 0 select 0 else 6*Factorial(n): n in [0..25]];
    
  • Mathematica
    Join[{0}, 6 Range[25]!]
  • PARI
    a(n) = if (n, 6*n!, 0); \\ Michel Marcus, Feb 15 2018

Formula

E.g.f.: 6*x/(1-x).
a(n) = n*a(n-1) = 6*A000142(n) for n>0.

Extensions

Edited by Bruno Berselli, Feb 13 2018

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).

A064482 Triangle read by rows: T(n,k) (n >= 2, 1<=k<=n-1) is the number of permutations p of 1,...,n with max(|p(i)-p(i-1)|, i=2..n) = k.

Original entry on oeis.org

2, 2, 4, 2, 10, 12, 2, 18, 52, 48, 2, 32, 146, 300, 240, 2, 54, 372, 1204, 1968, 1440, 2, 86, 954, 4082, 10476, 14640, 10080, 2, 134, 2376, 13348, 46012, 97968, 122400, 80640, 2, 206, 5704, 44274, 186202, 536652, 990960, 1139040, 725760, 2, 312, 13278, 145216, 742940, 2655004, 6562128, 10847520, 11692800, 7257600
Offset: 2

Views

Author

Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 05 2001

Keywords

Comments

T(n,n-1) = A052849; sum(T(n,k),k=1..n-1) = A000142.

Examples

			Triangle T(n,k) begins:
  2;
  2,   4;
  2,  10,   12;
  2,  18,   52,    48;
  2,  32,  146,   300,   240;
  2,  54,  372,  1204,  1968,  1440;
  2,  86,  954,  4082, 10476, 14640,  10080;
  2, 134, 2376, 13348, 46012, 97968, 122400, 80640;
		

Crossrefs

Extensions

More terms from Naohiro Nomoto, Dec 04 2001
More terms from R. J. Mathar, Oct 11 2007

A256881 a(n) = n!/ceiling(n/2).

Original entry on oeis.org

1, 2, 3, 12, 40, 240, 1260, 10080, 72576, 725760, 6652800, 79833600, 889574400, 12454041600, 163459296000, 2615348736000, 39520825344000, 711374856192000, 12164510040883200, 243290200817664000, 4644631106519040000, 102181884343418880000, 2154334728240414720000
Offset: 1

Views

Author

M. F. Hasler, Apr 22 2015

Keywords

Comments

Original name was: n!/round(n/2). - Robert Israel, Sep 03 2018

Crossrefs

Programs

  • Magma
    [Factorial(n)/Round(n/2): n in [1..30]]; // Vincenzo Librandi, Apr 23 2015
  • Maple
    A256881 := n!/round(n/2);
  • Mathematica
    Function[x, 1/x] /@
    CoefficientList[Series[(Sinh[x] + x*Exp[x])/2, {x, 0, 20}], x] (* Pierre-Alain Sallard, Dec 15 2018 *)
  • PARI
    A256881(n)=n!/round(n/2)
    

Formula

a(2n) = 2*A009445(n) = A052612(2n-1) = A052616(2n-1) = A052849(2n-1) = A098558(2n-1) = A081457(3n-1) = A208529(2n+1) = A256031(2n-1).
a(2n+1) = A110468(n) = A107991(2n+2) = A229244(2n+1), n>=0.
From Robert Israel, Sep 03 2018: (Start)
E.g.f.: -(1+1/x)*log(1-x^2).
n*(n+1)*(n+2)*a(n)+(n+2)*a(n+1)-(n+3)*a(n+2)=0. (End)
a(n) = 2/([x^n](sinh(x) + x*exp(x))). - Pierre-Alain Sallard, Dec 15 2018
Sum_{n>=1} 1/a(n) = (3*e-1/e)/4 = (e + sinh(1))/2. - Amiram Eldar, Feb 02 2023

Extensions

Definition clarified by Robert Israel, Sep 03 2018

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)

A360205 Triangle read by rows. T(n, k) = (-1)^(n-k)*(k+1)*binomial(n, k)*pochhammer(1-n, n-k).

Original entry on oeis.org

1, 0, 2, 0, 4, 3, 0, 12, 18, 4, 0, 48, 108, 48, 5, 0, 240, 720, 480, 100, 6, 0, 1440, 5400, 4800, 1500, 180, 7, 0, 10080, 45360, 50400, 21000, 3780, 294, 8, 0, 80640, 423360, 564480, 294000, 70560, 8232, 448, 9, 0, 725760, 4354560, 6773760, 4233600, 1270080, 197568, 16128, 648, 10
Offset: 0

Views

Author

Peter Luschny, Feb 08 2023

Keywords

Comments

A refinement of the number of partial permutations of an n-set (A002720).
Also the coefficients of a shifted derivative of the unsigned Lah polynomials (A271703).

Examples

			Triangle T(n, k) starts:
[0] 1;
[1] 0,     2;
[2] 0,     4,      3;
[3] 0,    12,     18,      4;
[4] 0,    48,    108,     48,      5;
[5] 0,   240,    720,    480,    100,     6;
[6] 0,  1440,   5400,   4800,   1500,   180,    7;
[7] 0, 10080,  45360,  50400,  21000,  3780,  294,   8;
[8] 0, 80640, 423360, 564480, 294000, 70560, 8232, 448, 9;
		

Crossrefs

Cf. A052849 (column 1), A045991 (subdiagonal), A002720 (row sums), A271703.
Cf. A069138 (Stirling2 counterpart), A360174 (Stirling1 counterpart).

Programs

  • Maple
    T := (n, k) -> (-1)^(n - k)*(k + 1)*binomial(n, k)*pochhammer(1 - n, n - k):
    seq(seq(T(n, k), k = 0..n), n = 0..9);

A064484 Triangle T(n,k), n >= 2, n+1 <= k <= 2*n-1, number of permutations p of 1,...,n, with max(p(i)+p(i-1), i=2..n) = k.

Original entry on oeis.org

2, 2, 4, 4, 8, 12, 4, 32, 36, 48, 8, 64, 216, 192, 240, 8, 208, 648, 1536, 1200, 1440, 16, 416, 3024, 6144, 12000, 8640, 10080, 16, 1280, 9072, 37632, 60000, 103680, 70560, 80640, 32, 2560, 38880, 150528, 456000, 622080, 987840, 645120, 725760
Offset: 2

Views

Author

Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 05 2001

Keywords

Examples

			For n=3 we have:
T(3,4)=2 with the permutations {312, 213} and
T(3,5)=4 with {123, 321, 132, 231}.
		

Crossrefs

Programs

  • Mathematica
    T[n_ /; n >= 2, k_] /; n+1 <= k <= 2n-1 := T[n, k] = If[EvenQ[k], (k-n)* T[n-1, k-1], (k-n+1)*T[n-1, k-1] + 2*Sum[T[n-1, i], {i, n, k-2}]];
    T[1, 2] = 1; T[, ] = 0;
    Table[T[n, k], {n, 2, 10}, {k, n+1, 2n-1}] // Flatten (* Jean-François Alcover, Jul 19 2022 *)
  • Python
    # Generate n-th row (n>1) by checking all n! permutations
    from itertools import permutations
    def onerow(n):
      row=[0]*(n-1)
      for i in permutations(range(1, n+1)):
        row[max([j[0]+j[1] for j in zip(i, i[1:])])-n-1]+=1
      return row
    # Andrew Woods, Jun 18 2013
    
  • Python
    # Generate first twenty rows using recurrence
    rows=[[2]]; row=[2]
    for i in range(19):
      row=[(row[j]*(j+2)+sum(row[:j])*2) if (i+j)%2==1 else row[j]*(j+1) for j in range(i+1)]+[row[-1]*(i+2)]
      rows.append(row)
    # Andrew Woods, Jun 18 2013

Formula

Sum_{k=n+1..2*n-1} T(n,k) = n! = A000142(n).
T(n,2*n-1) = 2*(n-1)! = A052849(n-1).
From Andrew Woods, Jun 16 2013: (Start)
T(n, even k) = (k-n)*T(n-1,k-1);
T(n, odd k) = (k-n+1)*T(n-1,k-1)+2*sum(T(n-1,i) for i=n..k-2);
T(n,2*n-1) = 2*(n-1)!;
T(n,2*n-2) = 2*(n-1)!-2*(n-2)! for n>2;
T(n,2*n-3) = 4*(n-1)!-12*(n-2)!+4*(n-3)! for n>3;
T(n,2*n-4) = 4*(n-1)!-24*(n-2)!+28*(n-3)!-4*(n-4)! for n>4;
T(n,2*n-5) = 6*(n-1)!-60*(n-2)!+152*(n-3)!-96*(n-4)!+8*(n-5)! for n>5.
(End)

Extensions

More terms from Naohiro Nomoto, Nov 26 2001
Previous Showing 21-30 of 38 results. Next