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-8 of 8 results.

A285439 Sum T(n,k) of the entries in the k-th cycles of all permutations of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 4, 2, 21, 12, 3, 132, 76, 28, 4, 960, 545, 235, 55, 5, 7920, 4422, 2064, 612, 96, 6, 73080, 40194, 19607, 6692, 1386, 154, 7, 745920, 405072, 202792, 75944, 18736, 2816, 232, 8, 8346240, 4484808, 2280834, 911637, 254061, 46422, 5256, 333, 9
Offset: 1

Views

Author

Alois P. Heinz, Apr 19 2017

Keywords

Comments

Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.

Examples

			T(3,1) = 21 because the sum of the entries in the first cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 6+6+3+4+1+1 = 21.
Triangle T(n,k) begins:
       1;
       4,      2;
      21,     12,      3;
     132,     76,     28,     4;
     960,    545,    235,    55,     5;
    7920,   4422,   2064,   612,    96,    6;
   73080,  40194,  19607,  6692,  1386,  154,   7;
  745920, 405072, 202792, 75944, 18736, 2816, 232, 8;
  ...
		

Crossrefs

Columns k=1-2 give: A284816, A285489.
Row sums give A000142 * A000217 = A180119.
Main diagonal and first lower diagonal give: A000027, A006000 (for n>0).

Programs

  • Maple
    T:= proc(h) option remember; local b; b:=
          proc(n, l) option remember; `if`(n=0, [mul((i-1)!, i=l), 0],
            (p-> p+[0, (h-n+1)*p[1]*x^(nops(l)+1)])(b(n-1, [l[], 1]))+
             add((p-> p+[0, (h-n+1)*p[1]*x^j])(
             b(n-1, subsop(j=l[j]+1, l))), j=1..nops(l)))
          end: (p-> seq(coeff(p, x, i), i=1..n))(b(h, [])[2])
        end:
    seq(T(n), n=1..10);
  • Mathematica
    T[h_] := T[h] = Module[{b}, b[n_, l_] := b[n, l] = If[n == 0, {Product[(i - 1)!, {i, l}], 0}, # + {0, (h - n + 1)*#[[1]]*x^(Length[l] + 1)}&[b[n - 1, Append[l, 1]]] + Sum[# + {0, (h-n+1)*#[[1]]*x^j}&[b[n - 1, ReplacePart[ l, j -> l[[j]] + 1]]], {j, 1, Length[l]}]]; Table[Coefficient[#, x, i], {i, 1, n}]&[b[h, {}][[2]]]];
    Table[T[n], {n, 1, 10}] // Flatten (* Jean-François Alcover, May 25 2018, translated from Maple *)

Formula

Sum_{k=1..n} k * T(n,k) = n^2 * n! = A002775(n).

A285793 Sum T(n,k) of the k-th entries in all cycles of all permutations of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 4, 2, 18, 13, 5, 96, 83, 43, 18, 600, 582, 342, 192, 84, 4320, 4554, 2874, 1824, 1068, 480, 35280, 39672, 26232, 17832, 11784, 7080, 3240, 322560, 382248, 261288, 185688, 131256, 88920, 54360, 25200, 3265920, 4044240, 2834640, 2078640, 1534320, 1110960, 765360, 473760, 221760
Offset: 1

Views

Author

Alois P. Heinz, Apr 26 2017

Keywords

Comments

Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.

Examples

			T(3,2) = 13 because the sum of the second entries in all cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 2+3+2+3+3+0 = 13.
Triangle T(n,k) begins:
:      1;
:      4,      2;
:     18,     13,      5;
:     96,     83,     43,     18;
:    600,    582,    342,    192,     84;
:   4320,   4554,   2874,   1824,   1068,   480;
:  35280,  39672,  26232,  17832,  11784,  7080,  3240;
: 322560, 382248, 261288, 185688, 131256, 88920, 54360, 25200;
		

Crossrefs

Columns k=1-2 give: A001563, A285795.
Main diagonal and first lower diagonal give: A038720(n-1) (for n>1), A286175.
Row sums give A000142 * A000217 = A180119.

Formula

T(n,1) = n * n!.
T(n,n) = floor((n-1)!*(n+2)/2).

A284816 Sum of entries in the first cycles of all permutations of [n].

Original entry on oeis.org

1, 4, 21, 132, 960, 7920, 73080, 745920, 8346240, 101606400, 1337212800, 18920563200, 286442956800, 4620449433600, 79114299264000, 1433211107328000, 27387931963392000, 550604138692608000, 11617107089043456000, 256671161862635520000, 5926549291918295040000
Offset: 1

Views

Author

Alois P. Heinz, Apr 15 2017

Keywords

Comments

Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.
Also, the number of colorings of n+1 given balls, two thereof identical, using n given colors (each color is used). - Ivaylo Kortezov, Jan 27 2024

Examples

			a(3) = 21 because the sum of the entries in the first cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 6+6+3+4+1+1 = 21.
		

Crossrefs

Column k=1 of A285439.

Programs

  • Maple
    a:= n-> n!*(n*(n+1)-(n-1)*(n+2)/2)/2:
    seq(a(n), n=1..25);
    # second Maple program:
    a:= proc(n) option remember; `if`(n<2, n,
           (n^2+n+2)*n*a(n-1)/(n^2-n+2))
        end:
    seq(a(n), n=1..25);

Formula

a(n) = n!*(n*(n+1) - (n-1)*(n+2)/2)/2.
E.g.f.: -x*(x^2-2*x+2)/(2*(x-1)^3).
a(n) = (n^2+n+2)*n*a(n-1)/(n^2-n+2) for n > 1, a(n) = n for n < 2.
a(n) = n*A006595(n-1). - Ivaylo Kortezov, Feb 02 2024

A286231 Sum T(n,k) of the entries in the k-th last cycles of all permutations of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 5, 1, 25, 10, 1, 143, 79, 17, 1, 942, 634, 197, 26, 1, 7074, 5462, 2129, 417, 37, 1, 59832, 51214, 23381, 5856, 786, 50, 1, 563688, 523386, 269033, 80053, 13934, 1360, 65, 1, 5858640, 5813892, 3281206, 1111498, 232349, 29728, 2204, 82, 1
Offset: 1

Views

Author

Alois P. Heinz, May 04 2017

Keywords

Examples

			T(3,2) = 10 because the sum of the entries in the second last cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 0+0+3+4+1+2 = 10.
Triangle T(n,k) begins:
       1;
       5,      1;
      25,     10,      1;
     143,     79,     17,     1;
     942,    634,    197,    26,     1;
    7074,   5462,   2129,   417,    37,    1;
   59832,  51214,  23381,  5856,   786,   50,  1;
  563688, 523386, 269033, 80053, 13934, 1360, 65, 1;
  ...
		

Crossrefs

Column k=1 gives A285382.
Main diagonal and first lower diagonal give: A000012, A002522.
Row sums give A000142 * A000217 = A180119.

A300559 a(n) = n*(n+1)!/2 + 1.

Original entry on oeis.org

1, 2, 7, 37, 241, 1801, 15121, 141121, 1451521, 16329601, 199584001, 2634508801, 37362124801, 566658892801, 9153720576001, 156920924160001, 2845499424768001, 54420176498688001, 1094805903679488001, 23112569077678080001, 510909421717094400001, 11802007641664880640001
Offset: 0

Views

Author

M. F. Hasler, Apr 10 2018

Keywords

Comments

See A301373 and A302859 for the primes: it is remarkable that all of a(1..10) are primes, and only a(11) is the first composite term.

Crossrefs

Inspired by A302859.
Cf. A301373.

Programs

Formula

a(n) = A180119(n) + 1 = A001286(n+1) + 1.
D-finite with recurrence n*a(n+1) = (n+1)*(n+2)*(a(n)-1) + n. - Chai Wah Wu, Apr 11 2018
E.g.f.: exp(x)-1/(x-1)^3*x. - Simon Plouffe, Jun 21 2018

A301373 Numbers k such that (k+1)!*k/2 + 1 is prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 19, 24, 251, 374, 953, 1104, 1507, 3390, 4443, 5762
Offset: 1

Views

Author

Daniel Suteu, Apr 03 2018

Keywords

Comments

The associated primes are A300559(a(n)) = A180119(a(n))+1 = A001286(a(n)+1)+1. - M. F. Hasler, Apr 10 2018
Looking for primes of the form p(n) = 1 + n! f(n) with a simple polynomial function f, it appears that the choice f(n) = n(n+1)/2 = A000217 is one of the most successful choices for getting a maximum of primes for n = 1..20. - M. F. Hasler, Apr 14 2018
The PFGW program has been used to certify all the terms up to a(23), using a deterministic test which exploits the factorization of a(n) - 1. - Giovanni Resta, Jun 24 2018

Crossrefs

See A302859 for the actual primes.

Programs

  • Mathematica
    Do[ If[ PrimeQ[n(n +1)!/2 +1], Print@ n], {n, 4000}] (* Robert G. Wilson v, Apr 05 2018 *)
  • PARI
    isok(k) = ispseudoprime((k+1)! * k / 2 + 1);

Extensions

a(21) from Robert G. Wilson v, Apr 05 2018
a(22) from Vaclav Kotesovec, Apr 06 2018
a(23) from Giovanni Resta, Jun 24 2018

A156815 Triangle T(n, k) = n!*StirlingS2(n, k)/binomial(n, k), read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 2, 6, 6, 0, 6, 28, 36, 24, 0, 24, 180, 300, 240, 120, 0, 120, 1488, 3240, 3120, 1800, 720, 0, 720, 15120, 43344, 50400, 33600, 15120, 5040, 0, 5040, 182880, 695520, 979776, 756000, 383040, 141120, 40320, 0, 40320, 2570400, 13068000, 22377600, 20018880, 11430720, 4656960, 1451520, 362880
Offset: 0

Views

Author

Roger L. Bagula, Feb 16 2009

Keywords

Examples

			Triangle begins as:
  1;
  0,    1;
  0,    1,      2;
  0,    2,      6,      6;
  0,    6,     28,     36,     24;
  0,   24,    180,    300,    240,    120;
  0,  120,   1488,   3240,   3120,   1800,    720;
  0,  720,  15120,  43344,  50400,  33600,  15120,   5040;
  0, 5040, 182880, 695520, 979776, 756000, 383040, 141120, 40320;
		

References

  • Steve Roman, The Umbral Calculus, Dover Publications, New York (1984), page 99.

Crossrefs

Programs

  • Magma
    [Factorial(n)*StirlingSecond(n,k)/Binomial(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jun 10 2021
    
  • Mathematica
    T[n_, k_] = n!*StirlingS2[n, k]/Binomial[n, k];
    Table[T[n, k], {n, 0, 12}, {k,0,n}]//Flatten
  • Sage
    flatten([[factorial(n)*stirling_number2(n,k)/binomial(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Jun 10 2021

Formula

T(n, k) = n!*StirlingS2(n, k)/binomial(n, k).
From G. C. Greubel, Jun 10 2021: (Start)
T(n, 1) = T(n, n) = n!.
T(n, 2) = 2*A029767(n+1).
T(n, n-1) = A180119(n). (End)

Extensions

Edited by G. C. Greubel, Jun 10 2021

A305739 a(n) = n!*T(n) - 1, where T(n) is the n-th triangular number.

Original entry on oeis.org

0, 5, 35, 239, 1799, 15119, 141119, 1451519, 16329599, 199583999, 2634508799, 37362124799, 566658892799, 9153720575999, 156920924159999, 2845499424767999, 54420176498687999, 1094805903679487999, 23112569077678079999, 510909421717094399999
Offset: 1

Views

Author

Maheswara Rao Valluri, Jun 22 2018

Keywords

Crossrefs

See A305738 for the indices of primes in this sequence.

Programs

  • Maple
    seq(n*(n+1)!/2-1,n=1..21);
  • PARI
    a(n) = n*(n+1)!/2 - 1; \\ Michel Marcus, Jun 23 2018

Formula

a(n) = n*(n+1)!/2 - 1. - Michel Marcus, Jun 23 2018
a(n) = A180119(n)-1 = A001286(n+1)-1. - Alois P. Heinz, Jun 24 2018
Showing 1-8 of 8 results.