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

A145877 Triangle read by rows: T(n,k) is the number of permutations of [n] for which the shortest cycle length is k (1<=k<=n).

Original entry on oeis.org

1, 1, 1, 4, 0, 2, 15, 3, 0, 6, 76, 20, 0, 0, 24, 455, 105, 40, 0, 0, 120, 3186, 714, 420, 0, 0, 0, 720, 25487, 5845, 2688, 1260, 0, 0, 0, 5040, 229384, 52632, 22400, 18144, 0, 0, 0, 0, 40320, 2293839, 525105, 223200, 151200, 72576, 0, 0, 0, 0, 362880, 25232230
Offset: 1

Views

Author

Emeric Deutsch, Oct 27 2008

Keywords

Comments

Row sums are the factorials (A000142).
Sum(T(n,k), k=2..n) = A000166(n) (the derangement numbers).
T(n,1) = A002467(n).
T(n,n) = (n-1)! (A000142).
Sum(k*T(n,k),k=1..n) = A028417(n).
For the statistic "length of the longest cycle", see A126074.

Examples

			T(4,2)=3 because we have 3412=(13)(24), 2143=(12)(34) and 4321=(14)(23).
Triangle starts:
      1;
      1,    1;
      4,    0,    2;
     15,    3,    0,    6;
     76,   20,    0,    0, 24;
    455,  105,   40,    0,  0, 120;
   3186,  714,  420,    0,  0,   0, 720;
  25487, 5845, 2688, 1260,  0,   0,   0, 5040;
  ...
		

Crossrefs

T(2n,n) gives A110468(n-1) (for n>0). - Alois P. Heinz, Apr 21 2017

Programs

  • Maple
    F:=proc(k) options operator, arrow: (1-exp(-x^k/k))*exp(-(sum(x^j/j, j = 1 .. k-1)))/(1-x) end proc: for k to 16 do g[k]:= series(F(k),x=0,16) end do: T:= proc(n,k) options operator, arrow: factorial(n)*coeff(g[k],x,n) end proc: for n to 11 do seq(T(n,k),k=1..n) end do; # yields sequence in triangular form
  • Mathematica
    Rest[Transpose[Table[Range[0, 16]! CoefficientList[
          Series[(Exp[x^n/n] -1) (Exp[-Sum[x^k/k, {k, 1, n}]]/(1 - x)), {x, 0, 16}],x], {n, 1, 8}]]] // Grid (* Geoffrey Critzer, Mar 04 2011 *)

Formula

E.g.f. for column k is (1-exp(-x^k/k))*exp( -sum(j=1..k-1, x^j/j ) ) / (1-x). - Vladeta Jovovic

A094310 Triangle read by rows: T(n,k), the k-th term of the n-th row, is the product of all numbers from 1 to n except k: T(n,k) = n!/k.

Original entry on oeis.org

1, 2, 1, 6, 3, 2, 24, 12, 8, 6, 120, 60, 40, 30, 24, 720, 360, 240, 180, 144, 120, 5040, 2520, 1680, 1260, 1008, 840, 720, 40320, 20160, 13440, 10080, 8064, 6720, 5760, 5040, 362880, 181440, 120960, 90720, 72576, 60480, 51840, 45360, 40320, 3628800, 1814400, 1209600, 907200, 725760, 604800, 518400, 453600, 403200, 362880
Offset: 1

Views

Author

Amarnath Murthy, Apr 29 2004

Keywords

Comments

The sum of the rows gives A000254 (Stirling numbers of first kind). The first column and the leading diagonal are factorials given by A000142 with offsets of 0 and 1.
T(n,k) is the number of length k cycles in all permutations of {1..n}.
Second diagonal gives A001048(n). - Anton Zakharov, Oct 24 2016
T(n,k) is the number of permutations of [n] with all elements of [k] in a single cycle. To prove this result, let m denote the length of the cycle containing {1,..,k}. Letting m run from k to n, we obtain T(n,k) = Sum_{m=k..n} (C(n-k,m-k)*(m-1)!*(n-m)!) = n!/k. See an example below. - Dennis P. Walsh, May 24 2020

Examples

			Triangle begins as:
      1;
      2,     1;
      6,     3,     2;
     24,    12,     8,     6;
    120,    60,    40,    30,   24;
    720,   360,   240,   180,  144,  120;
   5040,  2520,  1680,  1260, 1008,  840,  720;
  40320, 20160, 13440, 10080, 8064, 6720, 5760, 5040;
  ...
T(4,2) counts the 12 permutations of [4] with elements 1 and 2 in the same cycle, namely, (1 2)(3 4), (1 2)(3)(4), (1 2 3)(4), (1 3 2)(4), (1 2 4)(3), (1 4 2)(3), (1 2 3 4), (1 2 4 3), (1 3 2 4), (1 3 4 2), (1 4 2 3), and (1 4 3 2). - _Dennis P. Walsh_, May 24 2020
		

Crossrefs

Programs

  • Maple
    seq(seq(n!/k, k=1..n), n=1..10);
  • Mathematica
    Table[n!/k, {n,10}, {k,n}]//Flatten
    Table[n!/Range[n], {n,10}]//Flatten (* Harvey P. Dale, Mar 12 2016 *)

Formula

E.g.f. for column k: x^k/(k*(1-x)).
T(n,k)*k = n*n! = A001563(n).

Extensions

More terms from Philippe Deléham, Jun 11 2005

A349979 Irregular triangle read by rows: T(n,k) is the number of n-permutations whose second-longest cycle has length exactly k; n>=0, 0<=k<=floor(n/2).

Original entry on oeis.org

1, 1, 1, 1, 2, 4, 6, 15, 3, 24, 61, 35, 120, 290, 270, 40, 720, 1646, 1974, 700, 5040, 11025, 14707, 8288, 1260, 40320, 85345, 117459, 90272, 29484, 362880, 749194, 1023390, 974720, 446040, 72576, 3628800, 7347374, 9813210, 10666480, 6332040, 2128896
Offset: 0

Views

Author

Steven Finch, Dec 07 2021

Keywords

Comments

If the permutation has no second cycle, then its second-longest cycle is defined to have length 0.

Examples

			Triangle begins:
[0]     1;
[1]     1;
[2]     1,     1;
[3]     2,     4;
[4]     6,    15,      3;
[5]    24,    61,     35;
[6]   120,   290,    270,    40;
[7]   720,  1646,   1974,   700;
[8]  5040, 11025,  14707,  8288,  1260;
[9] 40320, 85345, 117459, 90272, 29484;
    ...
		

Crossrefs

Column 0 gives 1 together with A000142.
Column 1 gives 1 - (n-1)! + A006231(n).
Row sums give A000142.
T(2n,n) gives A110468(n-1) for n>=1.

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, x^l[1], add((j-1)!*
          b(n-j, sort([l[], j])[2..3])*binomial(n-1, j-1), j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n/2))(b(n, [0$2])):
    seq(T(n), n=0..12);  # Alois P. Heinz, Dec 07 2021
  • Mathematica
    b[n_, l_] := b[n, l] = If[n == 0, x^l[[1]], Sum[(j - 1)!*b[n - j, Sort[ Append[l, j]][[2 ;; 3]]]*Binomial[n - 1, j - 1], {j, 1, n}]];
    T[n_] := With[{p = b[n, {0, 0}]}, Table[Coefficient[p, x, i], {i, 0, n/2}]];
    Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Dec 28 2021, after Alois P. Heinz *)

Formula

Sum_{k=0..floor(n/2)} k * T(n,k) = A332851(n). - Alois P. Heinz, Dec 07 2021

A290053 Triangle read by rows: Polynomial coefficients per comment.

Original entry on oeis.org

1, 1, 0, 1, -2, 3, 1, -5, 10, 0, 1, -9, 31, -39, 40, 1, -14, 77, -196, 252, 0, 1, -20, 162, -664, 1457, -1476, 1260, 1, -27, 303, -1809, 6168, -11772, 12176, 0, 1, -35, 520, -4250, 20773, -61595, 107730, -95400, 72576, 1, -44, 836, -8954, 59279, -249986
Offset: 1

Views

Author

Gregory Gerard Wojnar, Jul 19 2017

Keywords

Comments

Let phi_(D,rho) be the average value of a generic degree D monic polynomial f when evaluated at the roots of the rho-th derivative of f, expressed as a polynomial in the averaged symmetric polynomials in the roots of f. [See arXiv:1706.08381 [math,GM], 2017.] The "last" term of phi_(D,rho) is a multiple of the product of all roots of f; the coefficient is expressible as a polynomial h_D(N) in N:=D-rho. These polynomials are of the form h_D(N) = ((-1)^D/(D-1)!)(D-N)N^chi*g_D(N) where chi = (1 if D is odd, 0 if D is even) and g_D(N) is a monic polynomial of degree (D-2-chi). Then a(n) are the coefficients of the polynomials N^chi*g_D(N), starting at D=2. The leading term of each row is 1 (polynomials are monic). The final terms in all even rows are 0. In each row, terms alternate in sign.

Examples

			Triangle begins:
1;
1,   0;
1,  -2,   3;
1,  -5,  10,     0;
1,  -9,  31,   -39,    40;
1, -14,  77,  -196,   252,      0;
1, -20, 162,  -664,  1457,  -1476,   1260;
1, -27, 303, -1809,  6168, -11772,  12176,      0;
1, -35, 520, -4250, 20773, -61595, 107730, -95400, 72576;
...
		

Crossrefs

The final terms in odd-numbered rows are A110468.
The negation of the second column give A000096.
The 3rd column is A290061; negation of 4th column is A290071; 5th column is A290127. Up to sign, all columns are given by polynomials described in the comments and examples of triangle A290761.

A202768 Vandermonde determinant of the first n squares.

Original entry on oeis.org

1, 1, 3, 120, 151200, 10973491200, 73004442255360000, 64942882916646518784000000, 10615517921765466641283416064000000000, 419534029722194863260820186269027926016000000000000, 5103425917047830280023316797736216735574814664897331200000000000000
Offset: 0

Views

Author

Clark Kimberling, Jan 01 2012

Keywords

Comments

Each term divides its successor, as in A110468.
a(m) is also the determinant of m X m matrix M(i,j) = i^(2*j)*cosh(2*j*arccsch(i)), with i from 1 to m, and j from 0 to m-1. - Federico Provvedi, Jan 20 2021

Examples

			a(3) = (4-1)(9-1)(9-4) = 120.
		

Crossrefs

Programs

  • Maple
    with(LinearAlgebra):
    a:= n-> Determinant(VandermondeMatrix([i^2$i=1..n])):
    seq(a(n), n=0..12);  # Alois P. Heinz, Aug 21 2014
  • Mathematica
    f[j_] := j^2; z = 15;
    v[n_] := Product[Product[f[k] - f[j], {j, 1, k - 1}], {k, 2, n}]
    Table[v[n], {n, 1, z}]    (* A202768 *)
    Table[v[n + 1]/v[n], {n, 1, z - 1}] (* A110468 *)
    (* or *)
    Det@TrigExpand@Array[#1^(2*#2)*Cosh[2*#2*ArcCsch[#1]]&,{#,#},{1,0}]&/@Range@16 (* Federico Provvedi, Jan 20 2021 *)
    Table[Exp[(n^2-1/24)*Log[2]-(n/2+1/4)*Log[Pi]+3/2*Log@Glaisher+Log@BarnesG[1+n]+Log@BarnesG[3/2+n]-1/8]/n!,{n, 0, 40}] (* Federico Provvedi, Apr 01 2021 after Vaclav Kotesovec's formula *)
  • PARI
    a(n)=prod(k=1,n,(2*k-1)!/k) /* Paul D. Hanna, Jan 02 2012 */
    
  • Python
    from math import prod
    def A202768(n): return (prod(((m:=k+1<<1)*(m+1))**(n-1-k)//(k+1) for k in range(1,n-1))*3**(n-1)<Chai Wah Wu, Nov 26 2023

Formula

a(n) = Product_{k=0..n-1} (2*k+1)!/(k+1) = Product_{k=0..n-1} A110468(k). - Paul D. Hanna, Jan 02 2012
a(n) ~ 2^(n^2 + n - 7/24) * n^(n^2 - n/2 - 13/24) * Pi^((n-1)/2) / (sqrt(A) * exp(3*n^2/2 - n/2 - 1/24)), where A is the Glaisher-Kinkelin constant A074962. - Vaclav Kotesovec, Jan 25 2019
a(n) = A168467(n) / A000142(n). - Federico Provvedi, Apr 01 2021
For n > 0, a(n) = sqrt(BarnesG(2*n)) * Gamma(2*n) / (n * Gamma(n)^(3/2) * 2^((n-1)/2)). - Vaclav Kotesovec, Nov 27 2024

Extensions

a(0) from Alois P. Heinz, Aug 21 2014

A346085 Number T(n,k) of permutations of [n] such that k is the GCD of the cycle lengths; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 4, 0, 2, 0, 15, 3, 0, 6, 0, 96, 0, 0, 0, 24, 0, 455, 105, 40, 0, 0, 120, 0, 4320, 0, 0, 0, 0, 0, 720, 0, 29295, 4725, 0, 1260, 0, 0, 0, 5040, 0, 300160, 0, 22400, 0, 0, 0, 0, 0, 40320, 0, 2663199, 530145, 0, 0, 72576, 0, 0, 0, 0, 362880
Offset: 0

Views

Author

Alois P. Heinz, Jul 04 2021

Keywords

Examples

			T(3,1) = 4: (1)(23), (13)(2), (12)(3), (1)(2)(3).
T(4,4) = 6: (1234), (1243), (1324), (1342), (1423), (1432).
Triangle T(n,k) begins:
  1;
  0,       1;
  0,       1,      1;
  0,       4,      0,     2;
  0,      15,      3,     0,    6;
  0,      96,      0,     0,    0,    24;
  0,     455,    105,    40,    0,     0, 120;
  0,    4320,      0,     0,    0,     0,   0, 720;
  0,   29295,   4725,     0, 1260,     0,   0,   0, 5040;
  0,  300160,      0, 22400,    0,     0,   0,   0,    0, 40320;
  0, 2663199, 530145,     0,    0, 72576,   0,   0,    0,     0, 362880;
  ...
		

Crossrefs

Columns k=0-1 give: A000007, A079128.
Even bisection of column k=2 gives A346086.
Row sums give A000142.
T(2n,n) gives A110468(n-1) for n >= 1.

Programs

  • Maple
    b:= proc(n, g) option remember; `if`(n=0, x^g, add((j-1)!
          *b(n-j, igcd(g, j))*binomial(n-1, j-1), j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, 0)):
    seq(T(n), n=0..12);
  • Mathematica
    b[n_, g_] := b[n, g] = If[n == 0, x^g, Sum[(j - 1)!*
         b[n - j, GCD[g, j]] Binomial[n - 1, j - 1], {j, n}]];
    T[n_] := CoefficientList[b[n, 0], x];
    Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Aug 30 2021, after Alois P. Heinz *)

Formula

Sum_{k=1..n} k * T(n,k) = A346066(n).
Sum_{prime p <= n} T(n,p) = A359951(n). - Alois P. Heinz, Jan 20 2023

A203476 a(n) = v(n+1)/v(n), where v = A203475.

Original entry on oeis.org

5, 130, 8500, 1051076, 211255200, 62840245000, 25959932960000, 14224928867370000, 9986120745657472000, 8740787543400204500000, 9333385482079885824000000, 11942338721669302523305000000, 18038821394494464638896640000000
Offset: 1

Views

Author

Clark Kimberling, Jan 02 2012

Keywords

Crossrefs

Programs

  • Magma
    [(&*[(n+1)^2 + j^2: j in [1..n]]): n in [1..20]]; // G. C. Greubel, Aug 28 2023
    
  • Mathematica
    (* First program *)
    f[j_]:= j^2; z = 15;
    v[n_]:= Product[Product[f[k] + f[j], {j,k-1}], {k,2,n}]
    Table[v[n], {n,z}]           (* A203475 *)
    Table[v[n+1]/v[n], {n,z-1}]  (* A203476 *)
    (* Second program *)
    Table[Product[j^2 +(n+1)^2 , {j,n}], {n,20}] (* G. C. Greubel, Aug 28 2023 *)
  • SageMath
    [product(j^2+(n+1)^2 for j in range(1,n+1)) for n in range(1,21)] # G. C. Greubel, Aug 28 2023

Formula

a(n) ~ 2^(n + 1/2) * exp(Pi*(n+1)/2 - 2*n) * n^(2*n). - Vaclav Kotesovec, Jan 25 2019
a(n) = Product_{j=1..n} ((n+1)^2 + j^2). - G. C. Greubel, Aug 28 2023

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

A229244 Number of n-permutations such that at least one cycle has size ceiling(n/2).

Original entry on oeis.org

1, 1, 3, 9, 40, 200, 1260, 8820, 72576, 653184, 6652800, 73180800, 889574400, 11564467200, 163459296000, 2451889440000, 39520825344000, 671854030848000, 12164510040883200, 231125690776780800, 4644631106519040000, 97537253236899840000, 2154334728240414720000, 49549698749529538560000, 1193170003333152768000000
Offset: 1

Views

Author

Geoffrey Critzer, Sep 17 2013

Keywords

Examples

			a(4) = 9 because we have:
1: (1)(2)(4,3)
2: (1)(3,2)(4)
3: (1)(4,2)(3)
4: (2,1)(3)(4)
5: (2,1)(4,3)
6: (3,1)(2)(4)
7: (3,1)(4,2)
8: (4,1)(2)(3)
9: (4,1)(3,2).
		

Crossrefs

Cf. A110468.

Programs

  • Mathematica
    f[n_]:=If[EvenQ[n],Binomial[n,n/2](n/2-1)!((n/2)!-(n/2-1)!)+n!/2/(n/2)^2,Binomial[n,Ceiling[n/2]]Floor[n/2]!^2]; Table[f[n],{n,1,25}]

Formula

For odd n, a(2m+1)= binomial(2m+1,m+1)*m!^2.
For even n, a(2m) = binomial(2m,m)*(m-1)!*(m!-(m-1)!) + (2m)!/(2*m^2).
Conjecture: (n+1)*a(n) +(-3*n+1)*a(n-1) -(n-2)*(n^2-2*n-1)*a(n-2) +(n-2)*(n-3)^2*a(n-3)=0. - R. J. Mathar, May 23 2014

A273878 Numerator of (2*(n+1)!/(n+2)).

Original entry on oeis.org

1, 4, 3, 48, 40, 1440, 1260, 8960, 72576, 7257600, 6652800, 958003200, 889574400, 11623772160, 163459296000, 41845579776000, 39520825344000, 12804747411456000, 12164510040883200, 231704953159680000, 4644631106519040000
Offset: 0

Views

Author

Johannes W. Meijer, Jun 08 2016

Keywords

Comments

The moments, i.e. E(X^n) = int(x^n * p(x), x = 0..infinity) for n > 0, of the probability density function p(x) = 2*x*E(x, 1, 1), see A163931, lead to this sequence.

Examples

			The first few moments of p(x) are: 1, 4/3, 3, 48/5, 40, 1440/7, … .
		

Crossrefs

Programs

  • Maple
    a := proc(n): numer(2*(n+1)!/(n+2)) end: seq(a(n), n=0..20);
  • PARI
    a(n) = numerator(2*(n+1)!/(n+2)) \\ Felix Fröhlich, Jun 09 2016

Formula

a(n) = numer(2*(n+1)!/(n+2))
a(n) = (n+1) * A090586(n+1)
a(2*n) = A110468(n) and a(2*n+1) = (2*n)!*A085250(n+1)/A128060(n+2).
Showing 1-10 of 11 results. Next