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 11-20 of 21 results. Next

A245693 Number T(n,k) of permutations on [n] that are self-inverse on [k] but not on [k+1]; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 0, 2, 2, 0, 0, 4, 12, 2, 0, 0, 10, 72, 18, 4, 0, 0, 26, 480, 120, 36, 8, 0, 0, 76, 3600, 840, 264, 84, 20, 0, 0, 232, 30240, 6480, 1920, 648, 216, 52, 0, 0, 764, 282240, 55440, 15120, 4920, 1776, 612, 152, 0, 0, 2620, 2903040, 524160, 131040, 39600, 13920, 5232, 1848, 464, 0, 0, 9496
Offset: 0

Views

Author

Alois P. Heinz, Jul 29 2014

Keywords

Comments

T(n,k) counts permutations p:{1,...,n}-> {1,...,n} with p(p(i))=i for all i in {1,...,k} and p(p(k+1))<>k+1 if k

Examples

			Triangle T(n,k) begins:
0 :      1;
1 :      0,    1;
2 :      0,    0,    2;
3 :      2,    0,    0,   4;
4 :     12,    2,    0,   0,  10;
5 :     72,   18,    4,   0,   0, 26;
6 :    480,  120,   36,   8,   0,  0, 76;
7 :   3600,  840,  264,  84,  20,  0,  0, 232;
8 :  30240, 6480, 1920, 648, 216, 52,  0,   0, 764;
		

Crossrefs

Column k=0 give A062119(n-1) for n>1.
Row sums give A000142.
Main diagonal gives A000085.
Cf. A245692 (the same for endofunctions).

Programs

  • Maple
    g:= proc(n) g(n):= `if`(n<2, 1, g(n-1)+(n-1)*g(n-2)) end:
    H:= (n, k)-> add(binomial(n-k, i)*binomial(k, i)*i!*
                 g(k-i)*(n-k-i)!, i=0..min(k, n-k)):
    T:= (n, k)-> H(n, k) -H(n, k+1):
    seq(seq(T(n, k), k=0..n), n=0..10);
  • Mathematica
    g[n_] := g[n] = If[n < 2, 1, g[n - 1] + (n - 1)*g[n - 2]];
    H[n_, k_] := Sum[Binomial[n - k, i]*Binomial[k, i]*i!*
         g[k - i]*(n - k - i)!, {i, 0, Min[k, n - k]}];
    T[n_, k_] := H[n, k] - H[n, k + 1];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* Jean-François Alcover, Feb 10 2021, after Alois P. Heinz *)

Formula

T(n,k) = H(n,k) - H(n,k+1) with H(n,k) = Sum_{i=0..min(k,n-k)} C(n-k,i) * C(k,i) * i! * A000085(k-i) * (n-k-i)!.

A333371 Exponential convolution of primorial numbers (A002110) with themselves.

Original entry on oeis.org

1, 4, 20, 132, 1116, 12420, 171300, 2884980, 56674380, 1289511300, 34769949060, 1063909626780, 37255008811020, 1470406699982220, 63114539746598340, 2936218980067393020, 150241360192861037100, 8497891914008911514100, 514514062115556069627060
Offset: 0

Author

Ilya Gutkovskiy, Mar 17 2020

Keywords

Programs

  • Maple
    p:= proc(n) option remember; `if`(n<1, 1, ithprime(n)*p(n-1)) end:
    a:= n-> add(p(i)*p(n-i)*binomial(n, i), i=0..n):
    seq(a(n), n=0..20);  # Alois P. Heinz, Mar 17 2020
  • Mathematica
    primorial[n_] := Product[Prime[k], {k, 1, n}]; a[n_] := Sum[Binomial[n, k] primorial[k] primorial[n - k], {k, 0, n}]; Table[a[n], {n, 0, 18}]

Formula

E.g.f.: (Sum_{k>=0} prime(k)# * x^k / k!)^2, where prime()# = A002110.
a(n) = Sum_{k=0..n} binomial(n,k) * prime(k)# * prime(n-k)#.

A350297 Triangle read by rows: T(n,k) = n!*(n-1)^k/k!.

Original entry on oeis.org

1, 1, 0, 2, 2, 1, 6, 12, 12, 8, 24, 72, 108, 108, 81, 120, 480, 960, 1280, 1280, 1024, 720, 3600, 9000, 15000, 18750, 18750, 15625, 5040, 30240, 90720, 181440, 272160, 326592, 326592, 279936, 40320, 282240, 987840, 2304960, 4033680, 5647152, 6588344, 6588344, 5764801
Offset: 0

Author

Robert B Fowler, Dec 23 2021

Keywords

Comments

Rows n >= 2 are coefficients in a double summation power series for the integral of x^(1/x), and the integral of its inverse function y^(y^(y^(y^(...)))). See A350358.

Examples

			Triangle T(n,k) begins:
  -----------------------------------------------------------------
   n\k     0      1      2       3       4       5       6       7
  -----------------------------------------------------------------
   0  |    1,
   1  |    1,     0,
   2  |    2,     2,     1,
   3  |    6,    12,    12,      8,
   4  |   24,    72,   108,    108,     81,
   5  |  120,   480,   960,   1280,   1280,   1024,
   6  |  720,  3600,  9000,  15000,  18750,  18750,  15625,
   7  | 5040, 30240, 90720, 181440, 272160, 326592, 326592, 279936.
  ...
		

Crossrefs

Cf. A000142 (first column), A062119 (second column), A065440 (main diagonal), A055897 (subdiagonal), A217701 (row sums).

Programs

  • Maple
    T := (n, k) -> (n!/k!)*(n - 1)^k:
    seq(seq(T(n, k), k = 0..n), n = 0..8); # Peter Luschny, Dec 24 2021
  • Mathematica
    T[1, 0] := 1; T[n_, k_] := n!*(n - 1)^k/k!; Table[T[n, k], {n, 0, 8}, {k, 0, n}] // Flatten (* Amiram Eldar, Dec 24 2021 *)

Formula

T(n, k) = binomial(n, k)*A350269(n, k). - Peter Luschny, Dec 25 2021
T(n+1, k) = A061711(n) * (n+1) / A350149(n, k). - Robert B Fowler, Jan 11 2022

A018931 The number of permutations of n cards in which 2 is the first card hit and 3 the next hit after 2.

Original entry on oeis.org

0, 1, 2, 12, 72, 480, 3600, 30240, 282240, 2903040, 32659200, 399168000, 5269017600, 74724249600, 1133317785600, 18307441152000, 313841848320000, 5690998849536000, 108840352997376000, 2189611807358976000, 46225138155356160000, 1021818843434188800000
Offset: 3

Keywords

Comments

From the game of Mousetrap.

References

  • Daniel J. Mundfrom, A problem in permutations: the game of "Mousetrap". European J. Combin. 15 (1994), no. 6, 555-560.

Crossrefs

Cf. A002468.

Formula

a(n) = A062119(n-3), n > 4. - R. J. Mathar, Oct 02 2008

Extensions

Offset changed to 3 and more precise definition provided by R. J. Mathar, Oct 02 2008

A120928 Number of "ups" and "downs" in the permutations of [n] if either a previous counted "up" ("down") or a "void" precedes an "up" ("down") which then will be counted also.

Original entry on oeis.org

2, 8, 44, 280, 2040, 16800, 154560, 1572480, 17539200, 212889600, 2794176000, 39437798400, 595718323200, 9589612032000, 163895187456000, 2964061900800000, 56554301067264000, 1135354270482432000, 23923536413736960000, 527939735774330880000
Offset: 2

Author

Thomas Wieder, Jul 16 2006

Keywords

Comments

An "up" ("down") is a neighboring pair of elements e_i, e_j of [n] with e_i < e_j (e_i > e_j). A "void" is a missing preceding pair, i.e., the start of [n]. We discuss two examples for [n=4]. In the permutation [3, 1, 2, 4] "void" precedes the pair 3,1 and consequently a "down" is counted. No "up" which has been counted precedes the "ups" 1,2 and 2,4 so they are not counted. In [3, 4, 1, 2] the "up" 3,4 is counted and so is the next "up" 1,2 but the down 4,1 has no preceding "down" registered and is therefore not counted.

Examples

			[1, 2, 3, 4], "ups"=3, "downs"=0;
[1, 2, 4, 3], "ups"=2, "downs"=0;
[1, 3, 2, 4], "ups"=2, "downs"=0;
[1, 3, 4, 2], "ups"=2, "downs"=0;
[1, 4, 2, 3], "ups"=2, "downs"=0;
[1, 4, 3, 2], "ups"=1, "downs"=0;
[2, 1, 3, 4], "ups"=0, "downs"=1;
[2, 1, 4, 3], "ups"=0, "downs"=2;
[2, 3, 1, 4], "ups"=2, "downs"=0;
[2, 3, 4, 1], "ups"=2, "downs"=0;
[2, 4, 1, 3], "ups"=2, "downs"=0;
[2, 4, 3, 1], "ups"=1, "downs"=0;
[3, 1, 2, 4], "ups"=0, "downs"=1;
[3, 1, 4, 2], "ups"=0, "downs"=2;
[3, 2, 1, 4], "ups"=0, "downs"=2;
[3, 2, 4, 1], "ups"=0, "downs"=2;
[3, 4, 1, 2], "ups"=2, "downs"=0;
[3, 4, 2, 1], "ups"=1, "downs"=0;
[4, 1, 2, 3], "ups"=0, "downs"=1;
[4, 1, 3, 2], "ups"=0, "downs"=2;
[4, 2, 1, 3], "ups"=0, "downs"=2;
[4, 2, 3, 1], "ups"=0, "downs"=2;
[4, 3, 1, 2], "ups"=0, "downs"=2;
[4, 3, 2, 1], "ups"=0, "downs"=3.
		

Crossrefs

Programs

  • Maple
    a:= n-> ceil(n!*(3*n-1)/6):
    seq(a(n), n=2..30); # Alois P. Heinz, Apr 21 2012

Formula

E.g.f.: -(6+6*x^2-4*x^3+x^4)/(-3+12*x-18*x^2+12*x^3-3*x^4). - Thomas Wieder, May 02 2009
a(2) = 2, a(n) = n! * (3*n - 1) / 6 for n > 2. - Jon E. Schoenfield, Apr 18 2010

Extensions

4 more terms from R. J. Mathar, Aug 25 2008
More terms from Alois P. Heinz, Apr 21 2012

A132431 For n>0, let B_n be the subsemigroup of the full transformation monoid on the n-set [n] generated by the following functions: Let x be a certain element in [n]. Now the generators of B are those functions which map either x to any distinct element y in [n] leaving all the other elements fixed, or y to x leaving all the other elements fixed. Then a(n) = number of elements in B_n.

Original entry on oeis.org

0, 2, 9, 88, 1385, 24336, 466753, 9906688, 233522577, 6093136000, 174912502721, 5487091383456, 186891076515481, 6870622015481056, 271195480556337345, 11440127985767481856, 513639921634424850977, 24455974520989478444544, 1230835712617872016215265
Offset: 1

Author

Simon Bogner (sisibogn(AT)stud.informatik.uni-erlangen.de), Nov 20 2007

Keywords

Comments

Let b(n)=n^n be the cardinality of the full transformation monoid. The sequence of quotients a(n)/b(n) converges to 1-1/e.

References

  • S. Bogner, Eine Praesentation der Halbgruppe der singularen zyklisch-monotonen Abbildungen UND eine von Idempotenten erzeugte Unterhalbgruppe von T_n (Studienarbeit in Informatik, Advisor: Klaus Leeb), Friedrich-Alexander-Universitaet Erlangen-Nuernberg, 2007.

Crossrefs

Programs

  • Haskell
    a132431 n = a060226 n - a062119 n + a002378 (n - 1)
    -- Reinhard Zumkeller, Aug 27 2012
  • Mathematica
    Join[{0},Table[n^n-n (n-1)^(n-1)-(n-1)n!+n(n-1),{n,2,20}]] (* Harvey P. Dale, Jun 07 2018 *)

Formula

a(n) = n^n - n*(n-1)^(n-1) - (n-1)*n! + n*(n-1).
a(n) = n*(n-1) + Sum_{k=1..n-2} k*Stirling2(n-1,k)*k!*C(n,k).
a(n) = A060226(n) - A062119(n) + A002378(n-1). - Reinhard Zumkeller, Aug 27 2012

A182062 T(n,k) = C(n+1-k,k)*k!*(n-k)!, the number of ways for k men and n-k women to form a queue in which no man is next to another man.

Original entry on oeis.org

1, 1, 1, 2, 2, 0, 6, 6, 2, 0, 24, 24, 12, 0, 0, 120, 120, 72, 12, 0, 0, 720, 720, 480, 144, 0, 0, 0, 5040, 5040, 3600, 1440, 144, 0, 0, 0, 40320, 40320, 30240, 14400, 2880, 0, 0, 0, 0, 362880, 362880, 282240, 151200, 43200, 2880, 0, 0, 0, 0, 3628800, 3628800
Offset: 0

Author

Dennis P. Walsh, Apr 09 2012

Keywords

Comments

Triangle T(n,k), 0<=k<=n, is readily derived since there are C(n+1-k,k) ways to form a sequence of k zeros and n-k ones in which no zeros are consecutive and there are k!(n-k)! ways to permute k labeled zeros and n-k labeled ones. This triangle contains several known sequences, notably A000142 (factorial numbers), A062119 (number of multiplications performed in a determinant), and A010796.

Examples

			T(4,2)=12 since there are 12 ways to line up two men {M,m} and two women {W,w} so that no man is next to another man, namely, MWmw, MWwm, MwmW, MwWm, mWMw, mWwM, mwMW, mwWM, WMwm, WmwM, wMWm, and wmWM.
Triangle T(n,k) begins
1,
1, 1,
2, 2, 0,
6, 6, 2, 0,
24, 24, 12, 0, 0,
120, 120, 72, 12, 0, 0,
720, 720, 480, 144, 0, 0, 0,
5040, 5040, 3600, 1440, 144, 0, 0, 0,
40320, 40320, 30240, 14400, 2880, 0, 0, 0, 0,
362880,362880,282240,151200,43200,2880,0,0,0,0,
3628800,3628800,2903040,1693440,604800,86400,0,0,0,0,0
		

Crossrefs

T(n,1) = A000142(n);
T(n,2) = A062119(n-1);
T(2n-1,n-1) = A010796;

Programs

  • Maple
    seq(seq(binomial(n+1-k,k)*k!*(n-k)!,k=0..n),n=0..10);
  • Mathematica
    Flatten[Table[Binomial[n+1-k,k]k!(n-k)!,{n,0,10},{k,0,n}]] (* Harvey P. Dale, Jul 15 2012 *)

Formula

binomial(n+1-k,k)*k!*(n-k)!
G.f. (fixed k): (1-k)*hypergeom([1, 1-k, 2-k],[2-2*k],t)*GAMMA(1-k)^2/GAMMA(2-2*k)
T(n,k)=(n+2-2k)*T(n-1,k-1)

A249631 Number of permutations p of {1,...,n} such that |p(i+1)-p(i)| < k, k=2,...,n; T(n,k), read by rows.

Original entry on oeis.org

2, 2, 6, 2, 12, 24, 2, 20, 72, 120, 2, 34, 180, 480, 720, 2, 56, 428, 1632, 3600, 5040, 2, 88, 1042, 5124, 15600, 30240, 40320, 2, 136, 2512, 15860, 61872, 159840, 282240, 362880, 2, 208, 5912, 50186, 236388, 773040, 1764000, 2903040, 3628800
Offset: 2

Author

Li-yao Xia, Nov 02 2014

Keywords

Examples

			Triangle starts with n=2:
2;
2,  6;
2, 12,  24;
2, 20,  72, 120;
2, 34, 180, 480, 720;
		

Crossrefs

Cf. A000142, main diagonal, A062119, subdiagonal.
Cf. A003274, A174700, A174701, A174702, 2nd to 5th columns, T(n,k), k=3,4,5,6.
Cf. A174703, A174704, A174705, A174706, A174707, A174708, similar definitions.

Programs

  • Haskell
    a n x = filter (\l -> all (< x) (zipWith (\x y -> abs (x - y)) l (tail l))) (permutations [1 .. n])
    
  • PARI
    isokp(perm, k) = {for (i=1, #perm-1, if (abs(perm[i]-perm[i+1]) >= k, return (0));); return (1);}
    tabl(nn) = {for (n=2, nn, for (k=2, n, print1(sum(i=1, n!, isokp(numtoperm(n, i), k)), ", ");); print(););} \\ Michel Marcus, Nov 06 2014

A361893 Triangle read by rows. T(n, k) = n! * binomial(n - 1, k - 1) / (n - k)!.

Original entry on oeis.org

1, 0, 1, 0, 2, 2, 0, 3, 12, 6, 0, 4, 36, 72, 24, 0, 5, 80, 360, 480, 120, 0, 6, 150, 1200, 3600, 3600, 720, 0, 7, 252, 3150, 16800, 37800, 30240, 5040, 0, 8, 392, 7056, 58800, 235200, 423360, 282240, 40320, 0, 9, 576, 14112, 169344, 1058400, 3386880, 5080320, 2903040, 362880
Offset: 0

Author

Peter Luschny, Mar 28 2023

Keywords

Examples

			Triangle T(n, k) starts:
  [0] 1;
  [1] 0, 1;
  [2] 0, 2,   2;
  [3] 0, 3,  12,     6;
  [4] 0, 4,  36,    72,     24;
  [5] 0, 5,  80,   360,    480,     120;
  [6] 0, 6, 150,  1200,   3600,    3600,     720;
  [7] 0, 7, 252,  3150,  16800,   37800,   30240,    5040;
  [8] 0, 8, 392,  7056,  58800,  235200,  423360,  282240,   40320;
  [9] 0, 9, 576, 14112, 169344, 1058400, 3386880, 5080320, 2903040, 362880;
		

Crossrefs

Cf. A052852 (row sums), A317365 (alternating row sums), A000142 (main diagonal), A187535 (central column), A062119, A055303, A011379.

Programs

  • Maple
    A361893 := (n, k) -> n!*binomial(n - 1, k - 1)/(n - k)!:
    seq(seq(A361893(n,k), k = 0..n), n = 0..9);
    # Using the egf.:
    egf := 1 + (x*y/(1 - x*y))*exp(y/(1 - x*y)): ser := series(egf, y, 10):
    poly := n -> convert(n!*expand(coeff(ser, y, n)), polynom):
    row := n -> seq(coeff(poly(n), x, k), k = 0..n): seq(print(row(n)), n = 0..6);

Formula

T(n, k) = k! * binomial(n, k) * binomial(n - 1, k - 1).
T(n + 1, k + 1) / (n + 1) = A144084(n, k) = (-1)^(n - k)*A021010(n, k).
T(n, k) = [x^k] n! * ([y^n](1 + (x*y / (1 - x*y)) * exp(y / (1 - x*y)))).

A372723 Triangle read by rows: Column k has e.g.f. t^k / ((1 - t)^(k + 1) * exp(t)).

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 2, 9, 12, 6, 9, 44, 84, 72, 24, 44, 265, 640, 780, 480, 120, 265, 1854, 5430, 8520, 7560, 3600, 720, 1854, 14833, 50988, 97650, 112560, 78120, 30240, 5040, 14833, 133496, 526568, 1189104, 1681680, 1525440, 866880, 282240, 40320
Offset: 0

Author

Peter Luschny, May 21 2024

Keywords

Examples

			Triangle starts:
[0]     1;
[1]     0,      1;
[2]     1,      2,      2;
[3]     2,      9,     12,       6;
[4]     9,     44,     84,      72,      24;
[5]    44,    265,    640,     780,     480,     120;
[6]   265,   1854,   5430,    8520,    7560,    3600,    720;
[7]  1854,  14833,  50988,   97650,  112560,   78120,  30240,   5040;
[8] 14833, 133496, 526568, 1189104, 1681680, 1525440, 866880, 282240, 40320;
		

Crossrefs

Cf. A000166 (column 0), A000142 (main diagonal), A062119 (subdiagonal), A000354 (row sums), A033999 (alternating row sums), A372716 (central terms).

Programs

  • Maple
    MAX := 14; gf := k -> t^k / ((1 - t)^(k + 1) * exp(t)):
    ser := k -> series(gf(k), t, MAX):
    col := k -> local n; seq(n!*coeff(series(ser(k), t, MAX-1), t, n), n = 0..MAX-2):
    T := (n, k) -> col(k)[n+1]:
    seq(lprint(seq(T(n, k), k = 0..n)), n = 0..8);
Previous Showing 11-20 of 21 results. Next