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

A056040 Swinging factorial, a(n) = 2^(n-(n mod 2))*Product_{k=1..n} k^((-1)^(k+1)).

Original entry on oeis.org

1, 1, 2, 6, 6, 30, 20, 140, 70, 630, 252, 2772, 924, 12012, 3432, 51480, 12870, 218790, 48620, 923780, 184756, 3879876, 705432, 16224936, 2704156, 67603900, 10400600, 280816200, 40116600, 1163381400, 155117520, 4808643120, 601080390, 19835652870, 2333606220
Offset: 0

Views

Author

Labos Elemer, Jul 25 2000

Keywords

Comments

a(n) is the number of 'swinging orbitals' which are enumerated by the trinomial n over [floor(n/2), n mod 2, floor(n/2)].
Similar to but different from A001405(n) = binomial(n, floor(n/2)), a(n) = lcm(A001405(n-1), A001405(n)) (for n>0).
A055773(n) divides a(n), A001316(floor(n/2)) divides a(n).
Exactly p consecutive multiples of p follow the least positive multiple of p if p is an odd prime. Compare with the similar property of A100071. - Peter Luschny, Aug 27 2012
a(n) is the number of vertices of the polytope resulting from the intersection of an n-hypercube with the hyperplane perpendicular to and bisecting one of its long diagonals. - Didier Guillet, Jun 11 2018 [Edited by Peter Munn, Dec 06 2022]

Examples

			a(10) = 10!/5!^2 = trinomial(10,[5,0,5]);
a(11) = 11!/5!^2 = trinomial(11,[5,1,5]).
		

Crossrefs

Programs

  • Magma
    [(Factorial(n)/(Factorial(Floor(n/2)))^2): n in [0..40]]; // Vincenzo Librandi, Sep 11 2011
    
  • Maple
    SeriesCoeff := proc(s,n) series(s(w,n),w,n+2);
    convert(%,polynom); coeff(%,w,n) end;
    a1 := proc(n) local k;
    2^(n-(n mod 2))*mul(k^((-1)^(k+1)),k=1..n) end:
    a2 := proc(n) option remember;
    `if`(n=0,1,n^irem(n,2)*(4/n)^irem(n+1,2)*a2(n-1)) end;
    a3 := n -> n!/iquo(n,2)!^2;
    g4 := z -> BesselI(0,2*z)*(1+z);
    a4 := n -> n!*SeriesCoeff(g4,n);
    g5 := z -> (1+z/(1-4*z^2))/sqrt(1-4*z^2);
    a5 := n -> SeriesCoeff(g5,n);
    g6 := (z,n) -> (1+z^2)^n+n*z*(1+z^2)^(n-1);
    a6 := n -> SeriesCoeff(g6,n);
    a7 := n -> combinat[multinomial](n,floor(n/2),n mod 2,floor(n/2));
    h := n -> binomial(n,floor(n/2)); # A001405
    a8 := n -> ilcm(h(n-1),h(n));
    F := [a1, a2, a3, a4, a5, a6, a7, a8];
    for a in F do seq(a(i), i=0..32) od;
  • Mathematica
    f[n_] := 2^(n - Mod[n, 2])*Product[k^((-1)^(k + 1)), {k, n}]; Array[f, 33, 0] (* Robert G. Wilson v, Aug 02 2010 *)
    f[n_] := If[OddQ@n, n*Binomial[n - 1, (n - 1)/2], Binomial[n, n/2]]; Array[f, 33, 0] (* Robert G. Wilson v, Aug 10 2010 *)
    sf[n_] := With[{f = Floor[n/2]}, Pochhammer[f+1, n-f]/f!]; (* or, twice faster: *) sf[n_] := n!/Quotient[n, 2]!^2; Table[sf[n], {n, 0, 32}] (* Jean-François Alcover, Jul 26 2013, updated Feb 11 2015 *)
  • PARI
    a(n)=n!/(n\2)!^2 \\ Charles R Greathouse IV, May 02 2011
    
  • Sage
    def A056040():
        r, n = 1, 0
        while True:
            yield r
            n += 1
            r *= 4/n if is_even(n) else n
    a = A056040(); [next(a) for i in range(36)]  # Peter Luschny, Oct 24 2013

Formula

a(n) = n!/floor(n/2)!^2. [Essentially the original name.]
a(0) = 1, a(n) = n^(n mod 2)*(4/n)^(n+1 mod 2)*a(n-1) for n>=1.
E.g.f.: (1+x)*BesselI(0, 2*x). - Vladeta Jovovic, Jan 19 2004
O.g.f.: a(n) = SeriesCoeff_{n}((1+z/(1-4*z^2))/sqrt(1-4*z^2)).
P.g.f.: a(n) = PolyCoeff_{n}((1+z^2)^n+n*z*(1+z^2)^(n-1)).
a(2n+1) = A046212(2n+1) = A100071(2n+1). - M. F. Hasler, Jan 25 2012
a(2*n) = binomial(2*n,n); a(2*n+1) = (2*n+1)*binomial(2*n,n). Central terms of triangle A211226. - Peter Bala, Apr 10 2012
D-finite with recurrence: n*a(n) + (n-2)*a(n-1) + 4*(-2*n+3)*a(n-2) + 4*(-n+1)*a(n-3) + 16*(n-3)*a(n-4) = 0. - Alexander R. Povolotsky, Aug 17 2012
Sum_{n>=0} 1/a(n) = 4/3 + 8*Pi/(9*sqrt(3)). - Alexander R. Povolotsky, Aug 18 2012
E.g.f.: U(0) where U(k)= 1 + x/(1 - x/(x + (k+1)*(k+1)/U(k+1))); (continued fraction, 3-step). - Sergei N. Gladkovskii, Oct 19 2012
Central column of the coefficients of the swinging polynomials A162246. - Peter Luschny, Oct 22 2013
a(n) = Sum_{k=0..n} A189231(n, 2*k). (Cf. A212303 for the odd case.) - Peter Luschny, Oct 30 2013
a(n) = hypergeometric([-n,-n-1,1/2],[-n-2,1],2)*2^(n-1)*(n+2). - Peter Luschny, Sep 22 2014
a(n) = 4^floor(n/2)*hypergeometric([-floor(n/2), (-1)^n/2], [1], 1). - Peter Luschny, May 19 2015
Sum_{n>=0} (-1)^n/a(n) = 4/3 - 4*Pi/(9*sqrt(3)). - Amiram Eldar, Mar 10 2022

Extensions

Extended and edited by Peter Luschny, Jun 28 2009

A189231 Extended Catalan triangle read by rows.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 3, 2, 3, 1, 2, 8, 3, 4, 1, 10, 5, 15, 4, 5, 1, 5, 30, 9, 24, 5, 6, 1, 35, 14, 63, 14, 35, 6, 7, 1, 14, 112, 28, 112, 20, 48, 7, 8, 1, 126, 42, 252, 48, 180, 27, 63, 8, 9, 1, 42, 420, 90, 480, 75, 270, 35, 80, 9, 10, 1, 462, 132, 990, 165, 825, 110, 385, 44, 99, 10, 11, 1
Offset: 0

Views

Author

Peter Luschny, May 01 2011

Keywords

Comments

Let S(n,k) denote the coefficients of the positive powers of the Laurent polynomials C_n(x) = (x+1/x)^(n-1)*(x-1/x)*(x+1/x+n) (if n>0) and C_0(x) = 0.
Then T(n,k) = S(n+1,k+1) for n>=0, k>=0.
The classical Catalan triangle A053121(n,k) can be recovered from this triangle by setting T(n,k) = 0 if n-k is odd.
The complementary Catalan triangle A189230(n,k) can be recovered from this triangle by setting T(n,k) = 0 if n-k is even.
T(n,0) are the extended Catalan numbers A057977(n).

Examples

			The Laurent polynomials:
C(0,x) =                 0
C(1,x) =               x - 1/x
C(2,x) =         x^2 + x - 1/x - 1/x^2
C(3,x) = x^3 + 2 x^2 + x - 1/x - 2/x^2 -1/x^3
Triangle T(n,k) = S(n+1,k+1) starts
[0]   1,
[1]   1,  1,
[2]   1,  2,  1,
[3]   3,  2,  3,  1,
[4]   2,  8,  3,  4,  1,
[5]  10,  5, 15,  4,  5,  1,
[6]   5, 30,  9, 24,  5,  6,  1,
[7]  35, 14, 63, 14, 35,  6,  7, 1,
    [0],[1],[2],[3],[4],[5],[6],[7]
		

Crossrefs

Programs

  • Maple
    A189231_poly := (n,x)-> `if`(n=0,0,(x+1/x)^(n-2)*(x-1/x)*(x+1/x+n-1)):
    seq(print([n],seq(coeff(expand(A189231_poly(n,x)),x,k),k=1..n)),n=1..9);
    A189231 := proc(n,k) option remember; `if`(k>n or k<0, 0, `if`(n=k, 1, A189231(n-1,k-1)+modp(n-k,2)*A189231(n-1,k)+A189231(n-1,k+1))) end:
    seq(print(seq(A189231(n,k),k=0..n)),n=0..9);
  • Mathematica
    t[n_, k_] /; (k > n || k < 0) = 0; t[n_, n_] = 1; t[n_, k_] := t[n, k] = t[n-1, k-1] + Mod[n-k, 2]*t[n-1, k] + t[n-1, k+1]; Table[t[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 30 2013 *)

Formula

Recurrence: If k>n or k<0 then T(n,k) = 0 else if n=k then T(n,k) = 1; otherwise T(n,k) = T(n-1,k-1) + ((n-k) mod 2)*T(n-1,k) + T(n-1,k+1).
S(n,k) = (k/n)* A162246(n,k) for n>0 where S(n,k) are the coefficients from the definition provided the triangle A162246 is indexed in Laurent style by the recurrence: if abs(k) > n then A162246(n,k) = 0 else if n = k then A162246(n,k) = 1 and otherwise A162246(n,k) = A162246(n-1,k-1)+ modp(n-k,2) * A162246(n-1,k) + A162246(n-1,k+1).
Row sums: A189911(n) = A162246(n,n) + A162246(n,n+1) for n>0.

A189911 Row sums of the extended Catalan triangle A189231.

Original entry on oeis.org

1, 2, 4, 9, 18, 40, 80, 175, 350, 756, 1512, 3234, 6468, 13728, 27456, 57915, 115830, 243100, 486200, 1016158, 2032316, 4232592, 8465184, 17577014, 35154028, 72804200, 145608400, 300874500, 601749000, 1240940160, 2481880320, 5109183315, 10218366630
Offset: 0

Views

Author

Peter Luschny, May 01 2011

Keywords

Crossrefs

Programs

  • Maple
    A189911 := proc(n) local a,b,d; if n = 0 then 1 else
    a := GAMMA(n-floor(n/2)); b := GAMMA(floor(n/2+3/2));
    d := GAMMA(floor(n/2+1))^2; GAMMA(n+1)*(a*b+d)/(a*b*d) fi end: seq(A189911(n),n=0..32);
    A189911 := proc(n) h:=irem(n,2); g:=iquo(n,2); (g+h+1)*binomial(2*g+h,g+h) end; # Peter Luschny, Oct 24 2013
  • Mathematica
    a[n_] := Module[{q, r}, {q, r} = QuotientRemainder[n, 2]; (q+r+1)*Pochhammer[q+1, q+r]/(q+r)!]; Table[a[n], {n, 0, 32}] (* Jean-François Alcover, Jan 09 2014 *)
  • Sage
    def A189911():
        r, n = 1, 1
        while True:
            yield r
            h = n//2
            r *= 2 if is_even(n) else (h+2)*(2*h+1)/(h+1)^2
            n += 1
    a = A189911(); [next(a) for i in range(16)]  # Peter Luschny, Oct 24 2013

Formula

Let a = Gamma(n-floor(n/2)), b = Gamma(floor(n/2+3/2)), d = Gamma( floor(n/2+1))^2, c = Gamma(n+1). Then a(n) = c*(a*b+d)/(a*b*d).
a(n) = A162246(n,n) + A162246(n,n+1) for n > 0.
From Peter Luschny, Oct 24 2013 : (Start)
E.g.f.: (x+1)*(BesselI(0, 2*x)+BesselI(1, 2*x)).
O.g.f.: I*(2*x^2-1)/(2*sqrt(2*x+1)*x*(2*x-1)^(3/2))-1/(2*x).
Recurrence: a(0) = 1; a(n) = a(n-1)*2 if n is even else ([n/2]+2)*(2*[n/2]+1)/([n/2]+1)^2. ([.] the floor brackets.)
a(n) = A056040(n) + A212303(n) = n$*(1+[(n+1)/2]^((-1)^n)), where n$ is the swinging factorial.
a(2*n) = (n+1)*C(2*n, n) (A037965);
a(2*n+1) = (n+2)*C(2*n+1, n+1) (A097070). (End)
Sum_{n>=0} 1/a(n) = 4*Pi/sqrt(3) - Pi^2/3 - 2. - Amiram Eldar, Aug 20 2022
D-finite with recurrence: (n-2)*(n+1)^2*a(n) - (2*(n-2)^2+2*n-12)*a(n-1) - 4*(n+2)*(n-1)^2*a(n-2) = 0. - Georg Fischer, Nov 25 2022

A189230 Complementary Catalan triangle read by rows.

Original entry on oeis.org

0, 1, 0, 0, 2, 0, 3, 0, 3, 0, 0, 8, 0, 4, 0, 10, 0, 15, 0, 5, 0, 0, 30, 0, 24, 0, 6, 0, 35, 0, 63, 0, 35, 0, 7, 0, 0, 112, 0, 112, 0, 48, 0, 8, 0, 126, 0, 252, 0, 180, 0, 63, 0, 9, 0, 0, 420, 0, 480, 0, 270, 0, 80, 0, 10, 0, 462, 0, 990, 0, 825, 0, 385, 0, 99, 0, 11, 0
Offset: 0

Views

Author

Peter Luschny, May 01 2011

Keywords

Comments

T(n,k) = A189231(n,k)*((n - k) mod 2). For comparison: the classical Catalan triangle is A053121(n,k) = A189231(n,k)*((n-k+1) mod 2).
T(n,0) = A138364(n). Row sums: A100071.

Examples

			[0]  0,
[1]  1,  0,
[2]  0,  2,  0,
[3]  3,  0,  3,  0,
[4]  0,  8,  0,  4,  0,
[5] 10,  0, 15,  0,  5, 0,
[6]  0, 30,  0, 24,  0, 6, 0,
[7] 35,  0, 63,  0, 35, 0, 7, 0,
   [0],[1],[2],[3],[4],[5],[6],[7]
		

Crossrefs

Programs

  • Maple
    A189230 := (n,k) -> A189231(n,k)*modp(n-k,2):
    seq(print(seq(A189230(n,k),k=0..n)),n=0..11);
  • Mathematica
    t[n_, k_] /; (k>n || k<0) = 0; t[n_, n_] = 1; t[n_, k_] := t[n, k] = t[n-1, k-1] + Mod[n-k, 2] t[n-1, k] + t[n-1, k+1];
    T[n_, k_] := t[n, k] Mod[n-k, 2];
    Table[T[n, k], {n, 0, 11}, {k, 0, n}] (* Jean-François Alcover, Jun 24 2019 *)

A177375 Triangle t(n,k): the coefficient [x^k] of the series (1+x)^n + 2*n*x*(1+x)^(n-2), in row n, column k.

Original entry on oeis.org

1, 1, 3, 1, 6, 1, 1, 9, 9, 1, 1, 12, 22, 12, 1, 1, 15, 40, 40, 15, 1, 1, 18, 63, 92, 63, 18, 1, 1, 21, 91, 175, 175, 91, 21, 1, 1, 24, 124, 296, 390, 296, 124, 24, 1, 1, 27, 162, 462, 756, 756, 462, 162, 27, 1, 1, 30, 205, 680, 1330, 1652, 1330, 680, 205, 30, 1
Offset: 0

Views

Author

Roger L. Bagula, May 07 2010

Keywords

Comments

Row sums are in A001792.

Examples

			1;
1, 3;
1, 6, 1;
1, 9, 9, 1;
1, 12, 22, 12, 1;
1, 15, 40, 40, 15, 1;
1, 18, 63, 92, 63, 18, 1;
1, 21, 91, 175, 175, 91, 21, 1;
1, 24, 124, 296, 390, 296, 124, 24, 1;
1, 27, 162, 462, 756, 756, 462, 162, 27, 1;
1, 30, 205, 680, 1330, 1652, 1330, 680, 205, 30, 1;
		

Crossrefs

Programs

  • Maple
    A177375 := proc(n,k)
        (1+x)^n+2*n*x*(1+x)^(n-2) ;
        coeftayl(%,x=0,k)
    end proc: # R. J. Mathar, May 19 2013
  • Mathematica
    p[x, 0, q_] := 1; p[x, 1, q_] := x + 1;
    p[x_, n_, q_] := p[x, n, q] = (1 + x)^n + 2*q*n*x*(1 + x)^(n - 2);
    Table[Flatten[Table[CoefficientList[p[x, n, q], x], {n, 0, 10}]], {q, 1, 10}]

A237884 a(n) = (n!*m)/(m!*(m+1)!) where m = floor(n/2).

Original entry on oeis.org

0, 0, 1, 3, 4, 20, 15, 105, 56, 504, 210, 2310, 792, 10296, 3003, 45045, 11440, 194480, 43758, 831402, 167960, 3527160, 646646, 14872858, 2496144, 62403600, 9657700, 260757900, 37442160, 1085822640, 145422675, 4508102925, 565722720, 18668849760, 2203961430
Offset: 0

Views

Author

Peter Luschny, Feb 14 2014

Keywords

Programs

  • Maple
    A237884 := proc(n) m := iquo(n,2); (n!*m)/(m!*(m+1)!) end;
    seq(A237884(n), n = 0..34);
  • Mathematica
    CoefficientList[Series[-((-1 + Sqrt[1 - 4 x^2] -x (-1 + Sqrt[1 - 4 x^2] +
    2 x (-3 + 2 Sqrt[1 - 4 x^2] +x (3 + 4 x - 2 Sqrt[1 - 4 x^2]))))/
    (2 x^2 (1 - 4 x^2)^(3/2))), {x, 0, 30}], x] (* Benedict W. J. Irwin, Aug 15 2016 *)
    Table[(n! #)/(#! (# + 1)!) &@ Floor[n/2], {n, 0, 34}] (* Michael De Vlieger, Aug 15 2016 *)
  • Sage
    def A237884():
        r, s, n = 1, 0, 0
        while True:
            yield s
            n += 1
            r *= 4/n if is_even(n) else n
            s = r * (n//2)/(n//2+1)
    a = A237884(); [next(a) for i in range(35)]

Formula

a(2*n) = A001791(n).
a(2*n+1) = A000917(n-1).
a(n) = n^(n mod 2)*binomial(2*floor(n/2), floor(n/2)-1).
a(n) = A162246(n, n+2) = n!/((n-ceiling((n+2)/2))!*floor((n+2)/2)!) if n > 1, otherwise 0.
a(n) = A056040(n)*floor(n/2)/(floor(n/2)+1).
a(n) + A056040(n) = A057977(n).
G.f.: -((p - 1 - x*(p - 1 + 2*x*(2*p - 3 + x*(3 + 4*x - 2*p))))/(2*x^2*p^3)), where p=sqrt(1-4*x^2). - Benedict W. J. Irwin, Aug 15 2016

A177276 Triangle T(n,k) with the coefficient [x^k] of the polynomial (1+x^2)^n + 2*n*x*(1+x^2)^(n-1) in row n, column k, 0<=k<=2n.

Original entry on oeis.org

1, 1, 2, 1, 1, 4, 2, 4, 1, 1, 6, 3, 12, 3, 6, 1, 1, 8, 4, 24, 6, 24, 4, 8, 1, 1, 10, 5, 40, 10, 60, 10, 40, 5, 10, 1, 1, 12, 6, 60, 15, 120, 20, 120, 15, 60, 6, 12, 1, 1, 14, 7, 84, 21, 210, 35, 280, 35, 210, 21, 84, 7, 14, 1, 1, 16, 8, 112, 28, 336, 56, 560, 70, 560, 56, 336, 28, 112
Offset: 0

Views

Author

Roger L. Bagula, May 06 2010

Keywords

Comments

Row sums are 1, 4, 12, 32, 80, 192, 448, 1024, 2304, 5120, 11264,..., A001787.
This is a generalization of A162246 to polynomials (1+x^2)^n + q*n*x*(1+x^2)^(n-1), here q=2.

Examples

			1;
1, 2, 1;
1, 4, 2, 4, 1;
1, 6, 3, 12, 3, 6, 1;
1, 8, 4, 24, 6, 24, 4, 8, 1;
1, 10, 5, 40, 10, 60, 10, 40, 5, 10, 1;
1, 12, 6, 60, 15, 120, 20, 120, 15, 60, 6, 12, 1;
1, 14, 7, 84, 21, 210, 35, 280, 35, 210, 21, 84, 7, 14, 1;
1, 16, 8, 112, 28, 336, 56, 560, 70, 560, 56, 336, 28, 112, 8, 16, 1;
1, 18, 9, 144, 36, 504, 84, 1008, 126, 1260, 126, 1008, 84, 504, 36, 144, 9, 18, 1;
1, 20, 10, 180, 45, 720, 120, 1680, 210, 2520, 252, 2520, 210, 1680, 120, 720, 45, 180, 10, 20, 1;
		

Crossrefs

Programs

  • Mathematica
    p[x_, n_] = (1 + x^2)^n + 2*n*x*(1 + x^2)^(n - 1);
    Table[CoefficientList[p[x, n], x], {n, 0, 10}];
    Flatten[%]
Showing 1-7 of 7 results.