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

A293211 Triangle T(n,k) is the number of permutations on n elements with at least one k-cycle for 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 4, 3, 2, 15, 9, 8, 6, 76, 45, 40, 30, 24, 455, 285, 200, 180, 144, 120, 3186, 1995, 1400, 1260, 1008, 840, 720, 25487, 15855, 11200, 8820, 8064, 6720, 5760, 5040, 229384, 142695, 103040, 79380, 72576, 60480, 51840, 45360, 40320, 2293839, 1427895, 1030400, 793800, 653184, 604800, 518400, 453600, 403200, 362880
Offset: 1

Views

Author

Dennis P. Walsh, Oct 02 2017

Keywords

Comments

T(n,k) is equivalent to n! minus the number of permutations on n elements with zero k-cycles (sequence A122974).

Examples

			T(n,k) (the first 8 rows):
:     1;
:     1,     1;
:     4,     3,     2;
:    15,     9,     8,    6;
:    76,    45,    40,   30,   24;
:   455,   285,   200,  180,  144,  120;
:  3186,  1995,  1400, 1260, 1008,  840,  720;
: 25487, 15855, 11200, 8820, 8064, 6720, 5760, 5040;
  ...
T(4,3)=8 since there are exactly 8 permutations on {1,2,3,4} with at least one 3-cycle: (1)(234), (1)(243), (2)(134), (2)(143), (3)(124), (3)(142), (4)(123), and (4)(132).
		

Crossrefs

Row sums give A132961.
T(n,n) gives A000142(n-1) for n>0.
T(2n,n) gives A052145.

Programs

  • Maple
    T:=(n,k)->n!*sum((-1)^(j+1)*(1/k)^j/j!,j=1..floor(n/k)); seq(seq(T(n,k),k=1..n),n=1..10);
  • Mathematica
    Table[n!*Sum[(-1)^(j + 1)*(1/k)^j/j!, {j, Floor[n/k]}], {n, 10}, {k, n}] // Flatten (* Michael De Vlieger, Oct 02 2017 *)

Formula

T(n,k) = n! * Sum_{j=1..floor(n/k)} (-1)^(j+1)*(1/k)^j/j!.
T(n,k) = n! - A122974(n,k).
E.g.f. of column k: (1-exp(-x^k/k))/(1-x). - Alois P. Heinz, Oct 11 2017

A094304 Sum of all possible sums formed from all but one of the previous terms, starting 1.

Original entry on oeis.org

1, 0, 1, 4, 18, 96, 600, 4320, 35280, 322560, 3265920, 36288000, 439084800, 5748019200, 80951270400, 1220496076800, 19615115520000, 334764638208000, 6046686277632000, 115242726703104000, 2311256907767808000, 48658040163532800000, 1072909785605898240000
Offset: 1

Views

Author

Amarnath Murthy, Apr 29 2004

Keywords

Comments

Apart from initial 1, same sequence as A001563. Additive analog of A057438.
a(1) = 1, for n >= 2: a(n) = sum of previous terms * (n-2) = (Sum_(i=1...n-2) a(i)) * (n-2). a(n) = A001563(n-2) = A094258(n-1) for n >= 3. - Jaroslav Krizek, Oct 16 2009

Examples

			a(2) = 0 as there is only one previous term and empty sum is taken to be 0.
a(4) = (a(1) +a(2))+ (a(1) +a(3)) + (a(2) +a(3)) = (1+0) +(1+1) +(0+1) = 4.
a(5) = (a(1)+a(2)+a(3)) +(a(1)+a(2)+ a(4)) +(a(1)+a(3)+a(4)) +(a(2)+a(3)+a(4)) = (1+0+1) +(1+0+4) +(1+1+4) +(0+1+4) = 2 + 5 + 6 + 5 = 18.
		

Crossrefs

Programs

  • Maple
    a := n -> (n-2)*(n-2)!: 1,seq(a(n), n=2..23); # Emeric Deutsch, May 01 2008
  • Mathematica
    In[2]:= l = {1}; Do[k = Length[l] - 1; p = Plus @@ Flatten[Select[Subsets[l], Length[ # ]==k& ]]; AppendTo[l, p], {n, 20}]; l (* Ryan Propper, May 28 2006 *)
  • PARI
    v=vector(30);v[1]=1;v[2]=0;for(n=3,#v,s=0;for(i=1,2^(n-1)-1, vb=binary(i); if(hammingweight(vb)==n-2,s=s+sum(j=1,#vb, if(vb[j], v[n-#vb+j-1]))));v[n]=s;print1(s,",")) /* Ralf Stephan, Sep 22 2013 */

Formula

a(n) = (n-2)!(n-2) for n>=2. - Emeric Deutsch, May 01 2008
G.f.: x*T(0), where T(k) = 1 - x^2*(k+1)^2/(x^2*(k+1)^2 - (1 -x -2*x*k)*(1 -3*x -2*x*k)/T(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Nov 10 2013
a(n) = S1(n,1) - S1(n-1,1), where S1 are the unsigned Stirling cycle numbers. - Peter Luschny, Apr 10 2016
a(n) = A122974(n-1,n-1). - Alois P. Heinz, Nov 24 2019

Extensions

Edited by N. J. A. Sloane, May 29 2006

A378495 Triangle read by rows: T(n,k) is the number of derangements in S_n with no k-cycles. 1 <= k <= n.

Original entry on oeis.org

0, 0, 0, 0, 2, 0, 0, 6, 9, 3, 0, 24, 24, 44, 20, 0, 160, 225, 175, 265, 145, 0, 1140, 1224, 1434, 1350, 1854, 1134, 0, 8988, 11025, 12313, 12145, 11473, 14833, 9793, 0, 80864, 93456, 100232, 106280, 113336, 107576, 133496, 93176, 0, 809856, 965601, 1057761, 1141425, 1108161, 1162161, 1108161, 1334961, 972081
Offset: 1

Views

Author

Peter Kagey, Nov 29 2024

Keywords

Comments

A derangement is a permutation with no fixed points.
Conjecture: For n >= 3, the GCD of the n-th row is n-1.

Examples

			Triangle begins:
   | 1      2      3       4       5       6       7       8      9
---+---------------------------------------------------------------
 1 | 0
 2 | 0,     0
 3 | 0,     2,     0
 4 | 0,     6,     9,      3
 5 | 0,    24,    24,     44,     20
 6 | 0,   160,   225,    175,    265,    145
 7 | 0,  1140,  1224,   1434,   1350,   1854,   1134
 8 | 0,  8988, 11025,  12313,  12145,  11473,  14833,   9793
 9 | 0, 80864, 93456, 100232, 106280, 113336, 107576, 133496, 93176
		

Crossrefs

Formula

T(n,1) = 0.
T(n,k) = Sum_{i=0..n} (-1)^i*binomial(n,i)*A122974(n-i,k) for k > 1.
T(n,2) = A038205(n).
T(n,n-1) = A000166(n) for n >= 3.
T(n,n) = A000166(n) - (n-1)! for n >= 3.
Conjecture: T(n,n-1) - T(n,n-2) = abs(A238474(n-4)) for n >= 4.
Conjecture: T(n,n-2) - T(n,n) = (n-3)!*(n-4)*(n-1)/2 for n >= 5.
Showing 1-3 of 3 results.