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 32 results. Next

A001900 Successive numerators of Wallis's approximation to Pi/2 (unreduced).

Original entry on oeis.org

1, 2, 4, 16, 64, 384, 2304, 18432, 147456, 1474560, 14745600, 176947200, 2123366400, 29727129600, 416179814400, 6658877030400, 106542032486400, 1917756584755200, 34519618525593600, 690392370511872000, 13807847410237440000, 303772643025223680000
Offset: 0

Views

Author

Keywords

Comments

a(n) = number of permutations of [n+1] all of whose non-initial left-to-right minima are at even positions in the permutation. For example, a(2) = 4 counts 123, 132, 213, 312. - David Callan, Jul 22 2008
Number of self-avoiding planar walks starting at (0,0), ending at (n,0), remaining in the first quadrant and using steps (0,1), (1,0), (-1,1), and (1,-1) with the restriction that (0,1) is never used below the diagonal and (1,0) is never used above the diagonal. a(2) = 4: [(0,0),(1,0),(2,0)], [(0,0),(0,1),(1,0),(2,0)], [(0,0),(0,1),(0,2),(1,1),(2,0)], [(0,0),(1,0),(0,1),(0,2),(1,1),(2,0)]. - Alois P. Heinz, Mar 23 2017
a(n+1) is the number of 0-1 square matrices of order n+1 with 2n+1 nonzero entries where the cell (i,j) is 1 for all i+j=n+2 and every diagonal, parallel to the main diagonal, has exactly one 1. For example, a(2) = 4: [(0,1,1), (1,1,0), (1,0,0)], [(0,1,1), (0,1,0), (1,1,0)], [(0,0,1), (1,1,1), (1,0,0)], [(0,0,1), (0,1,1), (1,1,0)]. - Christian Barrientos, Jul 17 2021

Examples

			From _Wolfdieter Lang_, Dec 06 2017: (Start)
Partial products of the rows N (for numerators a(n)) and D (for denominators b(n) = A000246(n+1)) begin:
n:    0  1  2  3  4   5    6     7      8       9       10 ...
N:    1  2  2  4  4   6    6     8      8      10       10 ...
D:    1  1  3  3  5   5    7     7      9       9       11 ...
a(n): 1  2  4 16 64 384 2304 18432 147456 14745601 4745600 ...
b(n): 1  1  3  9 45 225 1575 11025  99225   893025 9823275 ...  (End)
		

References

  • H.-D. Ebbinghaus et al., Numbers, Springer, 1990, p. 146.

Crossrefs

For the reduced form see A001901(n)/A001902(n), n >= 0.

Programs

  • Mathematica
    a[n_] := a[n] = If[n==0, 1, (n+Mod[n, 2]) a[n-1]];
    a /@ Range[0, 21] (* Jean-François Alcover, Jan 31 2020 *)
  • PARI
    a(n)=if(n<0,0,prod(k=1,n,if(k%2,k+1,k)))

Formula

2.2.4.4.6.6....2n.2n.../1.3.3.5.5.7.7....(2n-1).(2n+1) ...for n >= 1.
a(n) = 2^n * A010551(n) = 2^n * [n/2]! * [(n+1)/2]!. - Ralf Stephan, Mar 11 2004
Conjecture: a(n) - a(n-1) - n*(n-1)*a(n-2) = 0. - R. J. Mathar, Jun 07 2013 [The proof, for n >= 2, follows from the bisection recurrence given below. - Wolfdieter Lang, Dec 07 2017]
E.g.f.: E(0), where E(k)= 1 + 2*x*(k+1)/((2*k+1) - x*(2*k+1)/(x + 1/E(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 08 2013
G.f.: G(0), where G(k)= 1 + 2*x*(k+1)/(1 - 2*x*(k+1)/(2*x*(k+1) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 08 2013
Bisection: a(2*k+1) = ((2*k+1)+1)*a(2*k), a(2*k) = 2*k*a(2*k-1), k >= 0, with a(0) = 1. The proof is obvious from the numbers in the numerator (see the row N in the example). From a proposal by David James Sycamore, Nov 02 2017 based on the fractions 4/1, 8/3, 32/9, 128/45, ... converging very slowly to Pi, given on p. 16 of the Derbyshire link. - Wolfdieter Lang, Dec 06 2017
From Mathias Zechmeister, Jul 24 2022: (Start)
Let J_0(x) and J_1(x) denote the Bessel functions and i = sqrt(-1).
a(n) = denominator([x^n](J_0(x) + J_1(x))).
a(n) = denominator([x^n](J_0(i*x) - i*J_1(i*x))).
Bisection: a(2*k) = A002454(k), a(2*k+1) = A002474(k).
G.f. for 1/a(n): J_0(i*x) - i*J_1(i*x). (End)

A111942 Column 0 of the matrix logarithm (A111941) of triangle A111940, which shifts columns left and up under matrix inverse; these terms are the result of multiplying the element in row n by n!.

Original entry on oeis.org

0, 1, -1, 1, -2, 4, -12, 36, -144, 576, -2880, 14400, -86400, 518400, -3628800, 25401600, -203212800, 1625702400, -14631321600, 131681894400, -1316818944000, 13168189440000, -144850083840000, 1593350922240000, -19120211066880000
Offset: 0

Views

Author

Paul D. Hanna, Aug 23 2005

Keywords

Comments

Signed version of A010551, with leading zero.

Examples

			E.g.f.: A(x) = x - (1/2!)*x^2 + (1/3!)*x^3 - (2/4!)*x^4 + (4/5!)*x^5 - (12/6!)*x^6 + (36/7!)*x^7 - (144/8!)*x^8 + (576/9!)*x^9 + ... where A(x)*A(-x) = -arccos(1-x^2/2)^2.
		

Crossrefs

Cf. A111940 (triangle), A111941 (matrix log), A110505 (variant), A010551 (unsigned).

Programs

  • PARI
    {a(n,q=-1)=local(A=Mat(1),B);if(n<0,0, for(m=1,n+1,B=matrix(m,m);for(i=1,m, for(j=1,i, if(j==i,B[i,j]=1,if(j==1,B[i,j]=(A^q)[i-1,1], B[i,j]=(A^q)[i-1,j-1]));));A=B); B=sum(i=1,#A,-(A^0-A)^i/i);return(n!*B[n+1,1]))}

Formula

a(n) = (-1)^(n-1) * floor((n-1)/2)! * floor(n/2)! for n > 0, with a(0)=0.
E.g.f.: A(x) = (1-x/2)/sqrt(1-x^2/4)*arccos(1-x^2/2).
G.f.: x*G(0) where G(k) = 1 - (k+1)*x/(1 - x*(k+1)/(x*(k+1) - 1/G(k+1) )); (continued fraction, 3-step). - Sergei N. Gladkovskii, Nov 28 2012
G.f.: G(0)*x/2, where G(k) = 1 + 1/(1 - x*(k+1)/(x*(1*k+1) - 1/(1 + 1/(1 - x*(k+1)/(x*(1*k+1) - 1/G(k+1)))))); (continued fraction). - Sergei N. Gladkovskii, Jun 20 2013
G.f.: x/G(0), where G(k) = 1 - x*(k+1)/(x*(k+1) - 1/(1 - x*(k+1)/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 07 2013
Conjecture: 4*a(n) + 2*a(n-1) - (n-1)*(n-2)*a(n-2) = 0, n > 2. - R. J. Mathar, Nov 25 2015

A145893 Triangle read by rows: T(n,k) is the number of permutations p of {1,2,...,n} such that j and p(j) are of opposite parities for k values of j (0<=k<=n).

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 2, 0, 4, 0, 4, 0, 16, 0, 4, 12, 0, 72, 0, 36, 0, 36, 0, 324, 0, 324, 0, 36, 144, 0, 1728, 0, 2592, 0, 576, 0, 576, 0, 9216, 0, 20736, 0, 9216, 0, 576, 2880, 0, 57600, 0, 172800, 0, 115200, 0, 14400, 0, 14400, 0, 360000, 0, 1440000, 0, 1440000, 0, 360000, 0, 14400
Offset: 0

Views

Author

Emeric Deutsch, Nov 30 2008

Keywords

Comments

Mirror image of A145894.
Without the 0's it is the triangle of A145891.
Sum of entries in row n = n! = A000142(n).
Columns k=0,2,4,8,10,12 give: A010551, A226282, A226283, A226284, A226285, A226286. - Alois P. Heinz, May 29 2014

Examples

			T(3,2) = 4 because we have 132, 312, 213 and 231.
Triangle starts:
   1;
   1, 0;
   1, 0,   1;
   2, 0,   4, 0;
   4, 0,  16, 0,   4;
  12, 0,  72, 0,  36, 0;
  36, 0, 324, 0, 324, 0, 36;
  ...
		

Crossrefs

Programs

  • Maple
    T:=proc(n,k) if `mod`(n, 2) = 0 and `mod`(k, 2) = 0 then factorial((1/2)*n)^2*binomial((1/2)*n, (1/2)*k)^2 elif `mod`(n, 2) = 1 and `mod`(k, 2) = 0 then factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial((1/2)*n-1/2, (1/2)*k)*binomial((1/2)*n+1/2, (1/2)*k) else 0 end if end proc: for n from 0 to 10 do seq(T(n, k), k = 0 .. n) end do; # yields sequence in triangular form
  • Mathematica
    T[n_, k_] := Which[EvenQ[n] && EvenQ[k], (n/2)!^2*Binomial[n/2, k/2]^2, OddQ[n] && EvenQ[k], (n/2-1/2)!*(n/2+1/2)!*Binomial[n/2-1/2, k/2] * Binomial[n/2+1/2, k/2], True, 0]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Feb 20 2017, translated from Maple *)

Formula

T(2n,2k) = [n!*C(n,k)]^2; T(2n+1,2k) = n! (n+1)! C(n,k) C(n+1,k); elsewhere T(n,k)=0.

A145894 Triangle read by rows: T(n,k) is the number of permutations p of {1,2,...,n} such that j and p(j) are of the same parity for k values of j (0<=k<=n).

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 4, 0, 2, 4, 0, 16, 0, 4, 0, 36, 0, 72, 0, 12, 36, 0, 324, 0, 324, 0, 36, 0, 576, 0, 2592, 0, 1728, 0, 144, 576, 0, 9216, 0, 20736, 0, 9216, 0, 576, 0, 14400, 0, 115200, 0, 172800, 0, 57600, 0, 2880, 14400, 0, 360000, 0, 1440000, 0, 1440000, 0, 360000, 0, 14400
Offset: 0

Views

Author

Emeric Deutsch, Nov 30 2008

Keywords

Comments

Mirror image of A145893.
Without the 0's, it is the triangle of A134434.
Sum of entries in row n = n! = A000142(n).
T(n,n) = A010551(n).
Lower diagonals give: A226282, A226283, A226284, A226285, A226286. - Alois P. Heinz, May 29 2014

Examples

			T(3,1) = 4 because we have 132, 312, 213 and 231.
Triangle starts:
   1;
   0,  1;
   1,  0,   1;
   0,  4,   0,  2;
   4,  0,  16,  0,   4;
   0, 36,   0, 72,   0, 12;
  36,  0, 324,  0, 324,  0, 36;
  ...
		

Crossrefs

Programs

  • Maple
    T:=proc(n,k) if `mod`(n, 2) = 0 and `mod`(k, 2) = 0 then factorial((1/2)*n)^2*binomial((1/2)*n, (1/2)*k)^2 elif `mod`(n, 2) = 1 and `mod`(k, 2) = 1 then 2*factorial((1/2)*n+1/2)^2*binomial((1/2)*n-1/2, (1/2)*k-1/2)^2/(k+1) else 0 end if end proc: for n from 0 to 10 do seq(T(n, k), k=0..n) end do; # yields sequence in triangular form
  • Mathematica
    T[n_, k_] := Which[EvenQ[n] && EvenQ[k], (n/2)!^2*Binomial[n/2, k/2]^2, OddQ[n] && OddQ[k], (2*(n/2+1/2)!^2*Binomial[n/2-1/2, k/2-1/2]^2)/(k+1), True, 0]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Feb 19 2017, translated from Maple *)

Formula

T(2n,2k) = [n!*C(n,k)]^2; T(2n+1,2k+1) = [(n+1)!*C(n,k)]^2/(k+1); elsewhere T(n,k)=0.

A036440 Number of ways of arranging row n of the prime pyramid.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 4, 7, 24, 80, 216, 648, 1304, 3392, 13808, 59448, 155464, 480728, 1588162, 5626309, 28279112, 157469880, 842498189, 4998554801, 28466978744, 166572523589, 1020487969891, 5753385660978
Offset: 1

Views

Author

Keywords

Comments

Number of ways to arrange numbers from 1 to n in a row, starting with 1 and ending with n, such that the sum of every two adjacent numbers is prime.
From Daniel Forgues, May 18 2011: (Start)
Since the sum of any two adjacent entries is at least 3, the sum is thus an odd prime, which implies that any two consecutive entries have opposite parity. Since the first and last entries of row n are fixed to 1 and n, we have to find n-2 entries, where ceiling((n-2)/2) are even and floor((n-2)/2) are odd, so for row n the number of arrangements to investigate is
(ceiling((n-2)/2))! * (floor((n-2)/2))! (Cf. A010551(n-2), n >= 2.)
Prime pyramids are also (more fittingly?) called prime triangles. (End)

Examples

			a(8)=4 because of the 720 permutations P of {1,2,3,4,5,6,7,8} with first element 1 and last element 8, these four satisfy the "prime pyramid" condition that P[i] + P[i+1] be prime for i=1..7:
  1 2 3 4 7 6 5 8; (lexicographically earliest row 8)
  1 2 5 6 7 4 3 8;
  1 4 7 6 5 2 3 8;
  1 6 7 4 3 2 5 8.
For row 8, there are 6! = 720 permutations of {2,3,4,5,6}, but if we take into account that the parity of all entries of row n must alternate, we only have to consider ceiling((8-2)/2)! * floor((8-2)/2)! = 36 cases.
		

References

  • R. K. Guy, Unsolved Problems Number Theory, C1.

Crossrefs

Cf. A051237 for lexicographically earliest prime pyramid.

Programs

  • Mathematica
    prsQ[n_]:=AllTrue[Total/@Partition[n,2,1],PrimeQ]; Table[Count[Join[{1},#,{n}]&/@ Permutations[ Range[2,n-1]],?prsQ],{n,12}] (* _Harvey P. Dale, May 07 2023 *)

Extensions

More terms from Jud McCranie
a(25)-a(27) from Max Alekseyev, Jan 05 2008
a(28)-a(29) from Giovanni Resta, Apr 01 2014

A226288 T(n,k) = [n/2]!*[(n+1)/2]!*C([n/2],k-1)*C([(n+1)/2],k-1).

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 0, 4, 4, 0, 0, 0, 16, 12, 0, 0, 0, 4, 72, 36, 0, 0, 0, 0, 36, 324, 144, 0, 0, 0, 0, 0, 324, 1728, 576, 0, 0, 0, 0, 0, 36, 2592, 9216, 2880, 0, 0, 0, 0, 0, 0, 576, 20736, 57600, 14400, 0, 0, 0, 0, 0, 0, 0, 9216, 172800, 360000, 86400, 0, 0, 0, 0, 0, 0, 0, 576, 115200, 1440000, 2592000, 518400
Offset: 1

Views

Author

R. H. Hardin, connection of formula with combinatoric problem via N. J. A. Sloane in the Sequence Fans Mailing List, Jun 02 2013

Keywords

Comments

T(n,k)=Number of permutations of n elements with 2k-2 odd displacements
Table starts:
.........1...........0............0............0............0............0
.........1...........1............0............0............0............0
.........2...........4............0............0............0............0
.........4..........16............4............0............0............0
........12..........72...........36............0............0............0
........36.........324..........324...........36............0............0
.......144........1728.........2592..........576............0............0
.......576........9216........20736.........9216..........576............0
......2880.......57600.......172800.......115200........14400............0
.....14400......360000......1440000......1440000.......360000........14400
.....86400.....2592000.....12960000.....17280000......6480000.......518400
....518400....18662400....116640000....207360000....116640000.....18662400
...3628800...152409600...1143072000...2540160000...1905120000....457228800
..25401600..1244678400..11202105600..31116960000..31116960000..11202105600
.203212800.11379916800.119489126400.398297088000.497871360000.238978252800

Crossrefs

Column 1 is A010551.
Columns 2-7 are: A226282-A226287.
Cf. A145891 (another version as irregular triangle)

Programs

  • Mathematica
    T[n_,k_]:=(Floor[n/2])!*(Floor[(n+1)/2])!*Binomial[Floor[n/2],k-1]*Binomial[Floor[(n+1)/2],k-1]; Table[Reverse[Table[T[n-k+1,k],{k,n}]],{n,12}]//Flatten (* Stefano Spezia, Jul 12 2024 *)

A293857 a(n) is the number of permutations {c_1..c_n} of {1..n} for which c_1 - c_2 + ... + (-1)^(n-1)*c_n are squares.

Original entry on oeis.org

1, 1, 1, 4, 12, 36, 144, 1440, 9216, 66240, 504000, 7344000, 73612800, 830995200, 9373190400, 181875456000, 2474319052800, 38246274662400, 572552876851200, 13783143886848000, 237527801118720000, 4658378696294400000, 86818505051013120000, 2488457229932298240000
Offset: 0

Views

Author

Vladimir Shevelev, Oct 17 2017

Keywords

Comments

For a permutation C = {c_1..c_n} of {1..n}, set s(C) = c_1 - c_2 + ... + (-1)^(n-1)*c_n. Then max s(C) is square that is (ceil(n/2))^2 or A008794(n+1).
a(n)/n! is slowly and non-monotonically decreasing: 1, 1/2, 2/3, 1/2, 3/10, 1/5, 2/7, 8/35, 23/126, 5/36, 85/462, 71/462, ... .
Positions for which a(n) divisible by all primes <= n: 1, 4, 10, ... .
The smallest primes <= n not dividing a(n) or 0 if there is no such primes: 0, 2, 3, 0, 5, 5, 7, 5, 7, 0, 7, 7, ... .
Let k = floor(n / 2). Then a(n) = divisible by k! * (n-k)!. - David A. Corneth, Oct 18 2017. (For a proof, cf. comment in A293984. - Vladimir Shevelev, Nov 06 2017)

Examples

			Let n=3. For a permutation C={c_1,c_2,c_3}, set s = s(C) = c_1 - c_2 + c_3. We have the permutations:
1,2,3; s=2
1,3,2; s=0
2,1,3; s=4
2,3,1; s=0
3,1,2; s=4
3,2,1; s=2
Here there are 4 permutations for which {s} are squares. So a(3)=4.
		

Crossrefs

Programs

  • Maple
    b:= proc(p, m, s) option remember; (n-> `if`(n=0, `if`(issqr(s), 1, 0),
          `if`(p>0, b(p-1, m, s+n), 0)+`if`(m>0, b(p, m-1, s-n), 0)))(p+m)
        end:
    a:= n-> (t-> b(n-t, t, 0)*t!*(n-t)!)(iquo(n, 2)):
    seq(a(n), n=0..28);  # Alois P. Heinz, Sep 17 2020
  • Mathematica
    a293857=Table[Total[(Floor[n/2]!*(n-Floor[n/2])!)(Reverse[Map[SeriesCoefficient[QBinomial[n,Floor[(n+1)/2],q],{q,0,#}]&,Map[2#(Floor[(n+1)/2] - #)&,Range[0,Floor[(n+1)/4]]]]]
    )],{n,25}] (* Peter J. C. Moses, Nov 01 2017 *)

Formula

From author's comment in A008794 it follows that a(n) >= A010551(n).

Extensions

a(5)-a(12) from Peter J. C. Moses, Oct 17 2017
a(13)-a(23) from David A. Corneth, Oct 17 2017
a(0)=1 prepended by Alois P. Heinz, Sep 17 2020

A152662 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} for which k is the maximal number of initial odd entries (0 <= k <= ceiling(n/2)).

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 2, 2, 12, 8, 4, 48, 36, 24, 12, 360, 216, 108, 36, 2160, 1440, 864, 432, 144, 20160, 11520, 5760, 2304, 576, 161280, 100800, 57600, 28800, 11520, 2880, 1814400, 1008000, 504000, 216000, 72000, 14400, 18144000, 10886400, 6048000, 3024000
Offset: 0

Views

Author

Emeric Deutsch, Dec 13 2008

Keywords

Comments

Sum of entries in row n is n! (A000142).
Row n has 1 + ceiling(n/2) entries.
T(n,0) = A052591(n-1) for n>=1.
Sum_{k=0..ceiling(n/2)} k*T(n,k) = A152663(n).

Examples

			T(3,0)=2 because we have 213 and 231.
T(4,2)=4 because we have 1324, 1342, 3124 and 3142.
Triangle starts:
    1;
    0,   1;
    1,   1;
    2,   2,   2;
   12,   8,   4;
   48,  36,  24,  12;
  360, 216, 108,  36;
  ...
		

Crossrefs

Programs

  • Maple
    T := proc (n, k) if n=0 and k=0 then 1 elif n = 1 and k = 0 then 0 elif n = 1 and k = 1 then 1 elif `mod`(n, 2) = 1 then (1/2)*(n-1)*binomial((1/2)*n+1/2, k)*factorial(k)*factorial(n-1-k) else (1/2)*n*binomial((1/2)*n, k)*factorial(k)*factorial(n-1-k) end if end proc: for n from 0 to 11 do seq(T(n, k), k = 0 .. ceil((1/2)*n)) end do; # yields sequence in triangular form
  • Mathematica
    T[n_, k_] := T[n, k] = Which[n == 0 && k == 0, 1, n == 1 && k == 1, 1, OddQ[n], (n - 1)/2*k!*(n - k - 1)!*Binomial[(n - 1)/2 + 1, k], True, n/2*k!*(n - k - 1)!*Binomial[n/2, k]];
    Table[T[n, k], {n, 0, 11}, {k, 0, Ceiling[n/2]}] // Flatten (* Jean-François Alcover, Apr 04 2024 *)

Formula

T(2n+1,k) = n*k!*(2n-k)!*binomial(n+1,k) (n>= 1);
T(2n,k) = n*k!*(2n-1-k)!*binomial(n,k).
From Alois P. Heinz, Apr 02 2024: (Start)
Sum_{k>=0} (k+1) * T(n,k) = A256881(n+1).
T(n,ceiling(n/2)) = A010551(n). (End)

Extensions

T(0,0)=1 prepended by Alois P. Heinz, Apr 02 2024

A121697 Triangle read by rows: T(n,k) is the number of deco polyominoes of height n and having k columns ending at an odd level (0<=k<=n). A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 2, 2, 1, 1, 4, 8, 7, 3, 2, 14, 32, 37, 23, 10, 4, 44, 142, 207, 180, 97, 38, 12, 194, 730, 1267, 1327, 911, 425, 150, 36, 812, 3810, 8104, 10387, 8876, 5257, 2222, 708, 144, 4362, 23284, 56987, 84792, 85317, 60814, 31368, 11972, 3408, 576, 22716
Offset: 0

Views

Author

Emeric Deutsch, Aug 23 2006

Keywords

Comments

Row sums are the factorials (A000142).
T(n,0) = A121751(n), T(n,n) = A010551(n-1) for n>=1.
Sum_{k=0..n} k*T(n,k) = A121752(n).

Examples

			T(2,0)=1, T(2,1)=0 and T(2,2)=1 because the deco polyominoes of height 2 are the vertical and horizontal dominoes, having 0 and 2 columns ending at an odd level, respectively.
Triangle starts:
  1;
  0,1;
  1,0,1;
  2,2,1,1;
  4,8,7,3,2;
  14,32,37,23,10,4;
		

Crossrefs

Programs

  • Maple
    Q[0]:=1: Q[1]:=t: for n from 2 to 10 do Q[n]:=expand(subs({t=s,s=t},Q[n-1])+(t*floor(n/2)+s*floor((n-1)/2))*Q[n-1]) od: for n from 0 to 10 do P[n]:=sort(subs(s=1,Q[n])) od: for n from 0 to 10 do seq(coeff(P[n],t,j),j=0..n) od; # yields sequence in triangular form

Formula

The row generating polynomials P[n](t) are given by P[n](t) = Q[n](t,1), where Q[n](t,s) are defined by Q[n](t,s) = Q[n-1](s,t)+(floor(n/2)*t+floor((n-1)/2)*s)*Q[n-1](t,s) for n>=2 and Q[0](t,s) = 1, Q[1](t,s) = t.

A152666 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k runs of odd entries (1<=k<=ceiling(n/2)). For example, the permutation 321756498 has 3 runs of odd entries: 3, 175 and 9.

Original entry on oeis.org

1, 2, 4, 2, 12, 12, 36, 72, 12, 144, 432, 144, 576, 2592, 1728, 144, 2880, 17280, 17280, 2880, 14400, 115200, 172800, 57600, 2880, 86400, 864000, 1728000, 864000, 86400, 518400, 6480000, 17280000, 12960000, 2592000, 86400, 3628800, 54432000
Offset: 1

Views

Author

Emeric Deutsch, Dec 14 2008

Keywords

Comments

Sum of entries in row n is n! (=A000142(n)).
Row n contains ceiling(n/2) entries.
T(n,1) = A010551(n+1).
Sum_{k>=1} k*T(n,k) = A052618(n-1).
Mirror image of A134435.

Examples

			T(3,2)=2 because we have 123 and 321.
T(4,2)=12 because we have 1234, 1432, 3214, 3412, 1243, 3241 and their reverses.
Triangle starts:
1;
2;
4,2;
12,12;
36,72,12;
144,432,144;
576,2592,1728,144.
		

Crossrefs

Programs

  • Maple
    ae := proc (n, k) options operator, arrow: factorial(n)^2*binomial(n+1, k)*binomial(n-1, k-1) end proc: ao := proc (n, k) options operator, arrow: factorial(n)*factorial(n+1)*binomial(n, k-1)*binomial(n+1, k) end proc: T := proc (n, k) if `mod`(n, 2) = 0 then ae((1/2)*n, k) else ao((1/2)*n-1/2, k) end if end proc: for n to 12 do seq(T(n, k), k = 1 .. ceil((1/2)*n)) end do; # yields sequence in triangular form
  • Mathematica
    T[n_?EvenQ, k_] := (n/2)!^2*Binomial[n/2 - 1, k - 1]*Binomial[n/2 + 1, k]; T[n_?OddQ, k_] := ((n - 1)/2 + 1)!*((n - 1)/2)!*Binomial[(n - 1)/2 + 1, k]*Binomial[(n - 1)/2, k - 1]; Table[T[n, k], {n, 1, 12}, {k, 1, Floor[(n + 1)/2]}] // Flatten (* Jean-François Alcover, Nov 13 2016 *)

Formula

T(2n,k) = (n!)^2*binomial(n+1,k)*binomial(n-1,k-1).
T(2n+1,k) = n!*(n+1)!*binomial(n,k-1)*binomial(n+1,k).
Previous Showing 11-20 of 32 results. Next