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-5 of 5 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

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

A274885 Coefficients of some q-polynomials, P_n(q) = q_factorial(n+1) / (q_factorial([n/2]) * q_factorial([(n+2)/2])) with [.] the floor function.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 4, 6, 8, 9, 9, 8, 6, 4, 2, 1, 1, 1, 2, 3, 4, 4, 5, 4, 4, 3, 2, 1, 1, 1, 2, 4, 7, 11, 15, 20, 24, 27, 29, 29, 27, 24, 20, 15, 11, 7, 4, 2, 1, 1, 1, 2, 3, 5, 6, 8, 9, 11, 11, 12, 11, 11, 9, 8, 6, 5, 3, 2, 1, 1
Offset: 0

Views

Author

Peter Luschny, Jul 20 2016

Keywords

Examples

			The polynomials start:
[0] 1
[1] q + 1
[2] q^2 + q + 1
[3] (q + 1) * (q^2 + 1) * (q^2 + q + 1)
[4] (q^2 + 1) * (q^4 + q^3 + q^2 + q + 1)
[5] (q + 1)*(q^2 - q + 1)*(q^2 + 1)*(q^2 + q + 1) * (q^4 + q^3 + q^2 + q + 1)
Triangle starts:
[0] [1]
[1] [1, 1]
[2] [1, 1, 1]
[3] [1, 2, 3, 3, 2, 1]
[4] [1, 1, 2, 2, 2, 1, 1]
[5] [1, 2, 4, 6, 8, 9, 9, 8, 6, 4, 2, 1]
[6] [1, 1, 2, 3, 4, 4, 5, 4, 4, 3, 2, 1, 1]
[7] [1, 2, 4, 7, 11, 15, 20, 24, 27, 29, 29, 27, 24, 20, 15, 11, 7, 4, 2, 1]
		

Crossrefs

Cf. Row sums are A212303(n+1) and A275212(n,0), A274886.

Programs

  • Magma
    QFac:= func< n, x | n eq 0 select 1 else (&*[1-x^j: j in [1..n]])/(1-x)^n >;
    P:= func< n,x | QFac(n+1,x)/( QFac(Floor(n/2),x)*QFac(Floor((n+2)/2),x) ) >;
    R:=PowerSeriesRing(Integers(), 30);
    [Coefficients(R!( P(n,x) )): n in [0..8]]; // G. C. Greubel, May 22 2019
  • Maple
    Qbinom1 := proc(n) local F, h; h := iquo(n,2);
    F := x -> QDifferenceEquations:-QFactorial(x,q);
    F(n+1)/(F(h)*F(h+1)); expand(simplify(expand(%)));
    seq(coeff(%,q,j), j=0..degree(%)) end: seq(Qbinom1(n), n=0..8);
  • Mathematica
    QBinom1[n_] := QFactorial[n+1,q] / (QFactorial[Quotient[n,2],q] QFactorial[Quotient[n+2,2],q]); Table[CoefficientList[QBinom1[n] // FunctionExpand,q], {n,0,8}] // Flatten
  • Sage
    from sage.combinat.q_analogues import q_factorial
    def q_binom1(n): return (q_factorial(n+1)//(q_factorial(n//2)* q_factorial((n+2)//2)))
    for n in (0..10): print(q_binom1(n).list())
    

A275212 Triangle read by rows, T(n,k) = (n+k+1)! / ([(n-k)/2]! * [(n+k+2)/2]!) with [.] the floor function, for n>=0 and 0<=k<=n.

Original entry on oeis.org

1, 2, 3, 3, 12, 20, 12, 20, 120, 210, 10, 120, 210, 1680, 3024, 60, 105, 1680, 3024, 30240, 55440, 35, 840, 1512, 30240, 55440, 665280, 1235520, 280, 504, 15120, 27720, 665280, 1235520, 17297280, 32432400, 126, 5040, 9240, 332640, 617760, 17297280, 32432400, 518918400, 980179200
Offset: 0

Views

Author

Peter Luschny, Jul 20 2016

Keywords

Examples

			Triangle starts:
[0] [1]
[1] [2, 3]
[2] [3, 12, 20]
[3] [12, 20, 120, 210]
[4] [10, 120, 210, 1680, 3024]
[5] [60, 105, 1680, 3024, 30240, 55440]
[6] [35, 840, 1512, 30240, 55440, 665280, 1235520]
[7] [280, 504, 15120, 27720, 665280, 1235520, 17297280, 32432400]
		

Crossrefs

Cf. A001813 (subdiagonal), A006963 (main diagonal), A212303 (first column).

Programs

  • Mathematica
    Table[(n+k+1)!/(Floor[(n-k)/2]!Floor[(n+k+2)/2]!),{n,0,10},{k,0,n}]// Flatten (* Harvey P. Dale, Mar 27 2019 *)
  • Sage
    def T(n, k):
        return factorial(n+k+1)//(factorial((n-k)//2)*factorial((n+k+2)//2))
    for n in (0..7): print([T(n,k) for k in (0..n)])

A329965 a(n) = ((1+n)*floor(1+n/2))*(n!/floor(1+n/2)!)^2.

Original entry on oeis.org

1, 2, 6, 72, 240, 7200, 25200, 1411200, 5080320, 457228800, 1676505600, 221298739200, 821966745600, 149597947699200, 560992303872000, 134638152929280000, 508633022177280000, 155641704786247680000, 591438478187741184000, 224746621711341649920000
Offset: 0

Views

Author

Peter Luschny, Dec 04 2019

Keywords

Crossrefs

Programs

  • Maple
    A329965 := n -> ((1+n)*floor(1+n/2))*(n!/floor(1+n/2)!)^2:
    seq(A329965(n), n=0..19);
  • Mathematica
    ser := Series[(1 - Sqrt[1 - 4 x^2] - 4 x^2 (1 - x - Sqrt[1 - 4 x^2]))/(2 x^2 (1 - 4 x^2)^(3/2)), {x, 0, 22}]; Table[n! Coefficient[ser, x, n], {n, 0, 20}]
    Table[(1+n)Floor[1+n/2](n!/Floor[1+n/2]!)^2,{n,0,30}] (* Harvey P. Dale, Oct 01 2023 *)
  • Python
    from fractions import Fraction
    def A329965():
        x, n = 1, Fraction(1)
        while True:
            yield int(x)
            m = n if n % 2 else 4/(n+2)
            n += 1
            x *= m * n
    a = A329965(); [next(a) for i in range(36)]

Formula

a(n) = n!*A212303(n+1).
a(n) = (n+1)!*A057977(n).
a(n) = A093005(n+1)*A262033(n)^2.
a(n) = A093005(n+1)*A329964(n).
a(2*n) = A052510(n) (n >= 0).
a(2*n+1) = A123072(n+1) (n >= 0).
a(n) = n! [x^n] (1 - sqrt(1 - 4*x^2) - 4*x^2*(1 - x - sqrt(1 - 4*x^2)))/(2*x^2*(1 - 4*x^2)^(3/2)).
Showing 1-5 of 5 results.