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.

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.

This page as a plain text file.
%I A217540 #23 Oct 24 2016 05:58:44
%S A217540 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,
%T A217540 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,
%U A217540 6,0,1,0,0,1,21,112,245,301,266,197,128,80,39,26,6,7,0,1
%N 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.
%H A217540 Alois P. Heinz, <a href="/A217540/b217540.txt">Rows n = 0..100, flattened</a>
%H A217540 Peter Luschny, <a href="http://oeis.org/wiki/User:Peter_Luschny/OddsAndEnds#The_Scambler_statistic_on_Dyck_words">The Scambler_statistic_on_Dyck_words</a>.
%F A217540 T(n,-1) = A014531(n-2) = [0,0,0],1,3,10,30,90,...
%F A217540 T(n, 0) = A113682(n-2) = [1,0],1,1,4,9,26,70,197,...
%F A217540 T(n, 1) = A194588(n-1) = [0],1,0,2,2,8,17,49,128,...
%F A217540 Sum(k>=0,T(n,k))     = A189912(n-1) = [1],1,2,4,10,25, 66,177,..
%F A217540 Sum(k< 0,T(n,k))     = A217539(n)   =   0,0,0,1, 4,17, 66,252,..
%F A217540 Sum(-n<=k<=n,T(n,k)) = A000108(n)   =   1,1,2,5,14,42,132,429,..
%e A217540 [n\k] -8,-7,-6, -5,  -4,  -3,  -2,  -1,  0,   1,  2,  3,  4, 5, 6, 7, 8
%e A217540 -----------------------------------------------------------------------
%e A217540 [ 0 ]                                    1,
%e A217540 [ 1 ]                               0,   0,   1,
%e A217540 [ 2 ]                          0,   0,   1,   0,  1,
%e A217540 [ 3 ]                     0,   0,   1,   1,   2,  0,  1,
%e A217540 [ 4 ]                0,   0,   1,   3,   4,   2,  3,  0,  1,
%e A217540 [ 5 ]           0,   0,   1,   6,  10,   9,   8,  3,  4,  0, 1,
%e A217540 [ 6 ]       0,  0,   1,  10,  25,  30,  26,  17, 13,  4,  5, 0, 1,
%e A217540 [ 7 ]    0, 0,  1,  15,  56,  90,  90,  70,  49, 27, 19,  5, 6, 0, 1,
%e A217540 [ 8 ] 0, 0, 1, 21, 112, 245, 301, 266, 197, 128, 80, 39, 26, 6, 7, 0, 1
%e A217540 .
%e A217540 T(5, -2) = 6 counting the Dyck words
%e A217540 [1101011000] (()()(())) [1101100100] (()(())()) [1101101000] (()(()()))
%e A217540 [1110010100] ((())()()) [1110100100] ((()())()) [1110101000] ((()()())) .
%p A217540 b:= proc(x, y, t) option remember; `if`(y<0 or y>x, 0,
%p A217540       `if`(x=0, z, expand(`if`(y=0, z, 1)*(b(x-1, y+1, true)
%p A217540       +b(x-1, y-1, false)*`if`(t and y<>1, 1/z, 1)))))
%p A217540     end:
%p A217540 T:= n-> `if`(n=0, 1, (p-> seq(coeff(p, z, i), i=-n..n))
%p A217540                      (b(2*n-1, 1, true))):
%p A217540 seq(T(n), n=0..10);  # _Alois P. Heinz_, Jun 10 2014
%t A217540 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_ *)
%o A217540 (Sage)
%o A217540 def A217540(n, k):
%o A217540     def characteristic(d):
%o A217540         count = 1
%o A217540         h = d.heights()
%o A217540         for i in (1..len(d)-1):
%o A217540             if d[i-1]==1 and d[i]==0: count -= 1
%o A217540             if h[i]==0: count +=1
%o A217540             else:
%o A217540                 if h[i-1]==0 and h[i+1]==0: count += 1
%o A217540         return count
%o A217540     if n == 0: return 1
%o A217540     count = 0
%o A217540     for d in DyckWords(n):
%o A217540         if k == characteristic(d): count += 1
%o A217540     return count
%o A217540 for n in (0..6): [A217540(n, k) for k in (-n..n)]
%K A217540 nonn,tabf
%O A217540 0,14
%A A217540 _Peter Luschny_, Oct 21 2012