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.

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

A238452 Second column of the extended Catalan triangle A189231.

Original entry on oeis.org

0, 1, 2, 2, 8, 5, 30, 14, 112, 42, 420, 132, 1584, 429, 6006, 1430, 22880, 4862, 87516, 16796, 335920, 58786, 1293292, 208012, 4992288, 742900, 19315400, 2674440, 74884320, 9694845, 290845350, 35357670, 1131445440, 129644790, 4407922860, 477638700, 17194993200
Offset: 0

Views

Author

Peter Luschny, Mar 01 2014

Keywords

Crossrefs

Programs

  • Maple
    a := proc(n) option remember;
      if n < 3 then return n fi;
      if n mod 2 = 0 then return n*a(n-1) fi;
      h := iquo(n,2); n*a(n-1)/(h*(h+2)) end:
    seq(a(n), n=0..36);
  • 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];
    a[n_] := t[n, 1];
    Table[a[n], {n, 0, 36}] (* Jean-François Alcover, Jul 10 2019 *)
  • Sage
    def A238452():
        a = 1; n = 2
        yield 0
        while True:
            yield a
            a *= n
            if is_odd(n):
                a /= (n//2*(n//2+2))
            n += 1
    a = A238452(); [next(a) for n in range(36)]

Formula

Definition: a(n) = binomial(n+1, floor(n/2)+1) / (floor(n/2)+2) if n is odd, and 2*binomial(n, floor(n/2)+1) otherwise.
a(n) = A189231(n, 1).
a(n) = A238762(n+1, n-1).
a(2*n) = A162551(n).
a(2*n+1) = A000108(n+1).
a(n) = A057977(n+1) - A057977(n)*((n+1) mod 2). - Peter Luschny, Aug 07 2016

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

A274709 A statistic on orbital systems over n sectors: the number of orbitals which rise to maximum height k over the central circle.

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 2, 3, 1, 10, 15, 5, 5, 9, 5, 1, 35, 63, 35, 7, 14, 28, 20, 7, 1, 126, 252, 180, 63, 9, 42, 90, 75, 35, 9, 1, 462, 990, 825, 385, 99, 11, 132, 297, 275, 154, 54, 11, 1, 1716, 3861, 3575, 2002, 702, 143, 13, 429, 1001, 1001, 637, 273, 77, 13, 1
Offset: 0

Views

Author

Peter Luschny, Jul 09 2016

Keywords

Comments

The definition of an orbital system is given in A232500 (see also the illustration there). The number of orbitals over n sectors is counted by the swinging factorial A056040.
Note that (sum row_n) / row_n(0) = 1,1,2,2,3,3,4,4,..., i.e. the swinging factorials are multiples of the extended Catalan numbers A057977 generalizing the fact that the central binomials are multiples of the Catalan numbers.
T(n, k) is a subtriangle of the extended Catalan triangle A189231.

Examples

			Triangle read by rows, n>=0. The length of row n is floor((n+2)/2).
[ n] [k=0,1,2,...] [row sum]
[ 0] [  1] 1
[ 1] [  1] 1
[ 2] [  1,   1] 2
[ 3] [  3,   3] 6
[ 4] [  2,   3,   1] 6
[ 5] [ 10,  15,   5] 30
[ 6] [  5,   9,   5,   1] 20
[ 7] [ 35,  63,  35,   7] 140
[ 8] [ 14,  28,  20,   7,  1] 70
[ 9] [126, 252, 180,  63,  9] 630
[10] [ 42,  90,  75,  35,  9,  1] 252
[11] [462, 990, 825, 385, 99, 11] 2772
[12] [132, 297, 275, 154, 54, 11, 1] 924
T(6, 2) = 5 because the five orbitals [-1, 1, 1, 1, -1, -1], [1, -1, 1, 1, -1, -1], [1, 1, -1, -1, -1, 1], [1, 1, -1, -1, 1, -1], [1, 1, -1, 1, -1, -1] raise to maximal height of 2 over the central circle.
		

Crossrefs

Cf. A008313, A039599 (even rows), A047072, A056040 (row sums), A057977 (col 0), A063549 (col 0), A112467, A120730, A189230 (odd rows aerated), A189231, A232500.
Other orbital statistics: A241477 (first zero crossing), A274706 (absolute integral), A274708 (number of peaks), A274710 (number of turns), A274878 (span), A274879 (returns), A274880 (restarts), A274881 (ascent).

Programs

  • Maple
    S := proc(n,k) option remember; `if`(k>n or k<0, 0, `if`(n=k, 1, S(n-1,k-1)+
    modp(n-k,2)*S(n-1,k)+S(n-1,k+1))) end: T := (n,k) -> S(n,2*k);
    seq(print(seq(T(n,k), k=0..iquo(n,2))), n=0..12);
  • Sage
    from itertools import accumulate
    # Brute force counting
    def unit_orbitals(n):
        sym_range = [i for i in range(-n+1, n, 2)]
        for c in Combinations(sym_range, n):
            P = Permutations([sgn(v) for v in c])
            for p in P: yield p
    def max_orbitals(n):
        if n == 0: return [1]
        S = [0]*((n+2)//2)
        for u in unit_orbitals(n):
            L = list(accumulate(u))
            S[max(L)] += 1
        return S
    for n in (0..10): print(max_orbitals(n))

A238762 Triangle read by rows, generalized ballot numbers, 0<=k<=n.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 2, 0, 3, 1, 0, 2, 0, 2, 0, 3, 0, 8, 0, 10, 1, 0, 3, 0, 5, 0, 5, 0, 4, 0, 15, 0, 30, 0, 35, 1, 0, 4, 0, 9, 0, 14, 0, 14, 0, 5, 0, 24, 0, 63, 0, 112, 0, 126, 1, 0, 5, 0, 14, 0, 28, 0, 42, 0, 42, 0, 6, 0, 35, 0, 112, 0, 252, 0, 420, 0, 462
Offset: 0

Views

Author

Peter Luschny, Mar 05 2014

Keywords

Comments

Compare with the definition of the Motzkin triangle A238763.

Examples

			[n\k 0  1  2   3  4   5  6   7]
[0]  1,
[1]  0, 1,
[2]  1, 0, 1,
[3]  0, 2, 0,  3,
[4]  1, 0, 2,  0, 2,
[5]  0, 3, 0,  8, 0, 10,
[6]  1, 0, 3,  0, 5,  0, 5,
[7]  0, 4, 0, 15, 0, 30, 0, 35.
		

References

  • D. E. Knuth, TAOCP, Vol. 4a, Section 7.2.1.6, Eq. 22, p. 451.

Crossrefs

Programs

  • Maple
    binom2 := proc(n, k) local h;
       h := n -> (n-((1-(-1)^n)/2))/2;
       n!/(h(n-k)!*h(n+k)!) end:
    A238762 := proc(n, k) local a,b,c;
       a := iquo(n+k+2+modp(n,2), 2);
       b := iquo(n-k+2, 2);
       c := modp(n+k+1, 2);
       binom2(a,b)*b*c/a end:
    seq(print(seq(A238762(n, k), k=0..n)), n=0..7);
    # Alternativ:
    ballot := proc(p, q) option remember;
        if p = 0 and q = 0 then return 1 fi;
        if p < 0 or  p > q then return 0 fi;
        ballot(p-2, q) + ballot(p, q-2);
        if type(q, odd) then % + ballot(p-1, q-1) fi;
        % end:
  • Mathematica
    T[n_, k_] := T[n, k] = Which[k == 0 && n == 0, 1, k < 0 || k > n, 0, True, s = T[n, k - 2] + T[n - 2, k]; If[OddQ[n], s += T[n - 1, k - 1]]; s];
    Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 10 2019, adapted from Sage code *)
  • Sage
    @CachedFunction
    def ballot(p, q):
        if p == 0 and q == 0: return 1
        if p < 0 or p > q: return 0
        S = ballot(p-2, q) + ballot(p, q-2)
        if q % 2 == 1: S += ballot(p-1, q-1)
        return S
    for q in range(8): [ballot(p, q) for p in (0..q)]

Formula

Definition: T(0, 0) = 1; T(p, q) = 0 if p < 0 or p > q; T(p, q) = T(p-2, q) + (q mod 2) T(p-1, q-1) + T(p, q-2). (The notation is in the style of Knuth, TAOCP 4a (7.2.1.6)).
T(2*k, 2*n) are the classical ballot numbers A009766(n, k).
T(2*k-1, 2*n-1) = A238761(n, k).
T(n,k) = c*A189231(a, b) with a = floor((n + k + (k mod 2))/2), b = floor((n-k)/2) and c = ((n+k+1) mod 2).
T(n, k) = ((n+k+1) mod 2)*((floor(n/2)+floor(k/2) + 1)^(k mod 2)) * (binomial(floor(n/2) + floor(k/2), floor(n/2)) - binomial(floor(n/2) + floor(k/2), floor(n/2) + 1)).
T(n, k) = ((n+k+1) mod 2)*((floor(n/2)+floor(k/2) + 1)^(k mod 2)) * (floor((n-k)/2) + 1)/(floor(n/2) + 1) * binomial(floor(n/2) + floor(k/2), floor(n/2)).
T(n, n) = A057977(n).
T(n, n-2) = A238452(n-1).
Row sums are A238879.

A212303 a(n) = n!/([(n-1)/2]!*[(n+1)/2]!) for n>0, a(0)=0, and where [ ] = floor.

Original entry on oeis.org

0, 1, 2, 3, 12, 10, 60, 35, 280, 126, 1260, 462, 5544, 1716, 24024, 6435, 102960, 24310, 437580, 92378, 1847560, 352716, 7759752, 1352078, 32449872, 5200300, 135207800, 20058300, 561632400, 77558760, 2326762800, 300540195, 9617286240, 1166803110, 39671305740
Offset: 0

Views

Author

Peter Luschny, Oct 24 2013

Keywords

Comments

a(n) + A056040(n) = A189911(n), the row sums of the extended Catalan triangle A189231.

Crossrefs

Programs

  • Maple
    A212303 := proc(n) if n mod 2 = 0 then n*binomial(n, iquo(n,2))/2 else binomial(n+1, iquo(n,2)+1)/2 fi end: seq(A212303(i), i=0..36);
  • Mathematica
    a[n_?EvenQ] := n*Binomial[n, n/2]/2; a[n_?OddQ] := Binomial[n+1, Quotient[n, 2]+1]/2; Table[a[n], {n, 0, 36}]  (* Jean-François Alcover, Feb 05 2014 *)
    nxt[{n_,a_}]:={n+1,If[OddQ[n],a(n+1),(4a(n+1))/(n(n+2))]}; Join[{0}, Transpose[ NestList[ nxt,{1,1},40]][[2]]] (* Harvey P. Dale, Dec 20 2014 *)
  • Sage
    def A212303():
        yield 0
        r, n = 1, 1
        while True:
            yield r
            n += 1
            r *= n if is_even(n) else 4*n/((n-1)*(n+1))
    a = A212303(); [next(a) for i in range(36)]

Formula

E.g.f.: (1+x)*BesselI(1, 2*x).
O.g.f.: -((4*x^2-1)^(3/2)+I-(4*I)*x^2+(4*I)*x^3)/(2*x*(4*x^2-1)^(3/2)).
Recurrence: a(n) = n if n < 2 else a(n) = a(n-1)*n if n is even else a(n-1)*n*4/((n-1)*(n+1)).
a(2*n) = n*C(2*n, n) (A005430); a(2*n+1) = C(2*n+1, n+1) (A001700).
a(n) = n$*floor((n+1)/2)^((-1)^n), where n$ is the swinging factorial A056040.
a(n) = Sum_{k=0..n} A189231(n, 2*k+1).
Sum_{n>=1} 1/a(n) = 2/3 + (7/27)*sqrt(3)*Pi.
Sum_{n>=1} (-1)^(n+1)/a(n) = 2/3 + Pi/(9*sqrt(3)). - Amiram Eldar, Aug 20 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 *)
Showing 1-7 of 7 results.