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

A194589 a(n) = A194588(n) - A005043(n); complementary Riordan numbers.

Original entry on oeis.org

0, 0, 1, 1, 5, 11, 34, 92, 265, 751, 2156, 6194, 17874, 51702, 149941, 435749, 1268761, 3700391, 10808548, 31613474, 92577784, 271407896, 796484503, 2339561795, 6877992334, 20236257626, 59581937299, 175546527727, 517538571125, 1526679067331, 4505996000730
Offset: 0

Views

Author

Peter Luschny, Aug 30 2011

Keywords

Comments

The inverse binomial transform of a(n) is A194590(n).

Crossrefs

Programs

  • Maple
    # First method, describes the derivation:
    A056040 := n -> n!/iquo(n,2)!^2:
    A057977 := n -> A056040(n)/(iquo(n,2)+1);
    A001006 := n -> add(binomial(n,k)*A057977(k)*irem(k+1,2),k=0..n):
    A005043 := n -> `if`(n=0,1,A001006(n-1)-A005043(n-1)):
    A189912 := n -> add(binomial(n,k)*A057977(k),k=0..n):
    A194588 := n -> `if`(n=0,1,A189912(n-1)-A194588(n-1)):
    A194589 := n -> A194588(n)-A005043(n):
    # Second method, more efficient:
    A100071 := n -> A056040(n)*(n/2)^(n-1 mod 2):
    A194589 := proc(n) local k;
    (n mod 2)+(1/2)*add((-1)^k*binomial(n,k)*A100071(k+1),k=1..n) end:
    # Alternatively:
    a := n -> `if`(n<3,iquo(n,2),hypergeom([1-n/2,-n,3/2-n/2],[1,2-n],4)): seq(simplify(a(n)), n=0..30); # Peter Luschny, Mar 07 2017
  • Mathematica
    sf[n_] := With[{f = Floor[n/2]}, Pochhammer[f+1, n-f]/f!]; a[n_] := Mod[n, 2] + (1/2)*Sum[(-1)^k*Binomial[n, k]*2^-Mod[k, 2]*(k+1)^Mod[k, 2]*sf[k+1], {k, 1, n}]; Table[a[n], {n, 0, 10}] (* Jean-François Alcover, Jul 30 2013, from 2nd method *)
    Table[If[n < 3, Quotient[n, 2], HypergeometricPFQ[{1 - n/2, -n, 3/2 - n/2}, {1, 2-n}, 4]], {n,0,30}] (* Peter Luschny, Mar 07 2017 *)
  • Maxima
    a(n):=sum(binomial(n+2,k)*binomial(n-k,k),k,0,(n)/2); /* Vladimir Kruchinin, Sep 28 2015 */
    
  • PARI
    a(n) = sum(k=0, n/2, binomial(n+2,k)*binomial(n-k,k));
    vector(30, n, a(n-3)) \\ Altug Alkan, Sep 28 2015

Formula

a(n) = sum_{k=0..n} C(n,k)*A194590(k).
a(n) = (n mod 2)+(1/2)*sum_{k=1..n} (-1)^k*C(n,k)*(k+1)$*((k+1)/2)^(k mod 2). Here n$ denotes the swinging factorial A056040(n).
a(n) = PSUMSIGN([0,0,1,2,6,16,45,..] = PSUMSIGN([0,0,A005717]) where PSUMSIGN is from Sloane's "Transformations of integer sequences". - Peter Luschny, Jan 17 2012
A(x) = B'(x)*(1/x^2-1/(B(x)*x)), where B(x)/x is g.f. of A005043. - Vladimir Kruchinin, Sep 28 2015
a(n) = Sum_{k=0..n/2} C(n+2,k)*C(n-k,k). - Vladimir Kruchinin, Sep 28 2015
a(n) = hypergeom([1-n/2,-n,3/2-n/2],[1,2-n],4) for n>=3. - Peter Luschny, Mar 07 2017
a(n) ~ 3^(n + 1/2) / (8*sqrt(Pi*n)). - Vaclav Kotesovec, Feb 17 2024

A217540 Scambler statistic on Dyck paths. Triangle T(n, k) read by rows, n >= 0, -n <= k <= n, T(n, k) is the number of Dyck paths of semilength n and k = number of returns + number of hills - number of peaks.

Original entry on oeis.org

1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 2, 0, 1, 0, 0, 1, 3, 4, 2, 3, 0, 1, 0, 0, 1, 6, 10, 9, 8, 3, 4, 0, 1, 0, 0, 1, 10, 25, 30, 26, 17, 13, 4, 5, 0, 1, 0, 0, 1, 15, 56, 90, 90, 70, 49, 27, 19, 5, 6, 0, 1, 0, 0, 1, 21, 112, 245, 301, 266, 197, 128, 80, 39, 26, 6, 7, 0, 1
Offset: 0

Views

Author

Peter Luschny, Oct 21 2012

Keywords

Examples

			[n\k] -8,-7,-6, -5,  -4,  -3,  -2,  -1,  0,   1,  2,  3,  4, 5, 6, 7, 8
-----------------------------------------------------------------------
[ 0 ]                                    1,
[ 1 ]                               0,   0,   1,
[ 2 ]                          0,   0,   1,   0,  1,
[ 3 ]                     0,   0,   1,   1,   2,  0,  1,
[ 4 ]                0,   0,   1,   3,   4,   2,  3,  0,  1,
[ 5 ]           0,   0,   1,   6,  10,   9,   8,  3,  4,  0, 1,
[ 6 ]       0,  0,   1,  10,  25,  30,  26,  17, 13,  4,  5, 0, 1,
[ 7 ]    0, 0,  1,  15,  56,  90,  90,  70,  49, 27, 19,  5, 6, 0, 1,
[ 8 ] 0, 0, 1, 21, 112, 245, 301, 266, 197, 128, 80, 39, 26, 6, 7, 0, 1
.
T(5, -2) = 6 counting the Dyck words
[1101011000] (()()(())) [1101100100] (()(())()) [1101101000] (()(()()))
[1110010100] ((())()()) [1110100100] ((()())()) [1110101000] ((()()())) .
		

Programs

  • Maple
    b:= proc(x, y, t) option remember; `if`(y<0 or y>x, 0,
          `if`(x=0, z, expand(`if`(y=0, z, 1)*(b(x-1, y+1, true)
          +b(x-1, y-1, false)*`if`(t and y<>1, 1/z, 1)))))
        end:
    T:= n-> `if`(n=0, 1, (p-> seq(coeff(p, z, i), i=-n..n))
                         (b(2*n-1, 1, true))):
    seq(T(n), n=0..10);  # Alois P. Heinz, Jun 10 2014
  • Mathematica
    b[x_, y_, t_] := b[x, y, t] = If[y<0 || y>x, 0, If[x == 0, z, Expand[If[y == 0, z, 1]*(b[x-1, y+1, True]+b[x-1, y-1, False]*If[t && y != 1, 1/z, 1])]]]; T[n_] := If[n == 0, 1, Function[p, Table[Coefficient[p, z, i], {i, -n, n}]][b[2*n-1, 1, True]]]; Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Oct 24 2016, after Alois P. Heinz *)
  • Sage
    def A217540(n, k):
        def characteristic(d):
            count = 1
            h = d.heights()
            for i in (1..len(d)-1):
                if d[i-1]==1 and d[i]==0: count -= 1
                if h[i]==0: count +=1
                else:
                    if h[i-1]==0 and h[i+1]==0: count += 1
            return count
        if n == 0: return 1
        count = 0
        for d in DyckWords(n):
            if k == characteristic(d): count += 1
        return count
    for n in (0..6): [A217540(n, k) for k in (-n..n)]

Formula

T(n,-1) = A014531(n-2) = [0,0,0],1,3,10,30,90,...
T(n, 0) = A113682(n-2) = [1,0],1,1,4,9,26,70,197,...
T(n, 1) = A194588(n-1) = [0],1,0,2,2,8,17,49,128,...
Sum(k>=0,T(n,k)) = A189912(n-1) = [1],1,2,4,10,25, 66,177,..
Sum(k< 0,T(n,k)) = A217539(n) = 0,0,0,1, 4,17, 66,252,..
Sum(-n<=k<=n,T(n,k)) = A000108(n) = 1,1,2,5,14,42,132,429,..
Showing 1-2 of 2 results.